com.unboundid.ldap.sdk.DN.compare()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中com.unboundid.ldap.sdk.DN.compare()方法的一些代码示例,展示了DN.compare()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DN.compare()方法的具体详情如下:
包路径:com.unboundid.ldap.sdk.DN
类名称:DN
方法名:compare

DN.compare介绍

[英]Compares the provided DN values to determine their relative order in a sorted list.
[中]比较提供的DN值以确定它们在排序列表中的相对顺序。

代码示例

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

  1. /**
  2. * Compares the provided DN to this DN to determine their relative order in
  3. * a sorted list.
  4. *
  5. * @param dn The DN to compare against this DN. It must not be
  6. * {@code null}.
  7. *
  8. * @return A negative integer if this DN should come before the provided DN
  9. * in a sorted list, a positive integer if this DN should come after
  10. * the provided DN in a sorted list, or zero if the provided DN can
  11. * be considered equal to this DN.
  12. */
  13. public int compareTo(final DN dn)
  14. {
  15. return compare(this, dn);
  16. }

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

  1. /**
  2. * Compares the provided DN to this DN to determine their relative order in
  3. * a sorted list.
  4. *
  5. * @param dn The DN to compare against this DN. It must not be
  6. * {@code null}.
  7. *
  8. * @return A negative integer if this DN should come before the provided DN
  9. * in a sorted list, a positive integer if this DN should come after
  10. * the provided DN in a sorted list, or zero if the provided DN can
  11. * be considered equal to this DN.
  12. */
  13. public int compareTo(final DN dn)
  14. {
  15. return compare(this, dn);
  16. }

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

  1. /**
  2. * Compares the DNs with the provided string representations to determine
  3. * their relative order in a sorted list.
  4. *
  5. * @param s1 The string representation for the first DN to be compared. It
  6. * must not be {@code null}.
  7. * @param s2 The string representation for the second DN to be compared. It
  8. * must not be {@code null}.
  9. *
  10. * @return A negative integer if the first DN should come before the second
  11. * DN in a sorted list, a positive integer if the first DN should
  12. * come after the second DN in a sorted list, or zero if the two DN
  13. * values can be considered equal.
  14. *
  15. * @throws LDAPException If either of the provided strings cannot be parsed
  16. * as a DN.
  17. */
  18. public static int compare(final String s1, final String s2)
  19. throws LDAPException
  20. {
  21. return compare(s1, s2, null);
  22. }

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

  1. /**
  2. * Compares the DNs with the provided string representations to determine
  3. * their relative order in a sorted list.
  4. *
  5. * @param s1 The string representation for the first DN to be compared. It
  6. * must not be {@code null}.
  7. * @param s2 The string representation for the second DN to be compared. It
  8. * must not be {@code null}.
  9. *
  10. * @return A negative integer if the first DN should come before the second
  11. * DN in a sorted list, a positive integer if the first DN should
  12. * come after the second DN in a sorted list, or zero if the two DN
  13. * values can be considered equal.
  14. *
  15. * @throws LDAPException If either of the provided strings cannot be parsed
  16. * as a DN.
  17. */
  18. public static int compare(final String s1, final String s2)
  19. throws LDAPException
  20. {
  21. return compare(s1, s2, null);
  22. }

相关文章