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

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

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

DN.compareTo介绍

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

代码示例

代码示例来源: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.
  6. * It must not be {@code null}.
  7. * @param s2 The string representation for the second DN to be compared.
  8. * It must not be {@code null}.
  9. * @param schema The schema to use to generate the normalized string
  10. * representations of the DNs. It may be {@code null} if no
  11. * schema is available.
  12. *
  13. * @return A negative integer if the first DN should come before the second
  14. * DN in a sorted list, a positive integer if the first DN should
  15. * come after the second DN in a sorted list, or zero if the two DN
  16. * values can be considered equal.
  17. *
  18. * @throws LDAPException If either of the provided strings cannot be parsed
  19. * as a DN.
  20. */
  21. public static int compare(final String s1, final String s2,
  22. final Schema schema)
  23. throws LDAPException
  24. {
  25. return new DN(s1, schema).compareTo(new DN(s2, schema));
  26. }
  27. }

代码示例来源: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.
  6. * It must not be {@code null}.
  7. * @param s2 The string representation for the second DN to be compared.
  8. * It must not be {@code null}.
  9. * @param schema The schema to use to generate the normalized string
  10. * representations of the DNs. It may be {@code null} if no
  11. * schema is available.
  12. *
  13. * @return A negative integer if the first DN should come before the second
  14. * DN in a sorted list, a positive integer if the first DN should
  15. * come after the second DN in a sorted list, or zero if the two DN
  16. * values can be considered equal.
  17. *
  18. * @throws LDAPException If either of the provided strings cannot be parsed
  19. * as a DN.
  20. */
  21. public static int compare(final String s1, final String s2,
  22. final Schema schema)
  23. throws LDAPException
  24. {
  25. return new DN(s1, schema).compareTo(new DN(s2, schema));
  26. }
  27. }

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

  1. return parsedDN1.compareTo(parsedDN2);

相关文章