本文整理了Java中com.unboundid.ldap.sdk.DN.compareTo()
方法的一些代码示例,展示了DN.compareTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DN.compareTo()
方法的具体详情如下:
包路径:com.unboundid.ldap.sdk.DN
类名称: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
/**
* Compares the DNs with the provided string representations to determine
* their relative order in a sorted list.
*
* @param s1 The string representation for the first DN to be compared.
* It must not be {@code null}.
* @param s2 The string representation for the second DN to be compared.
* It must not be {@code null}.
* @param schema The schema to use to generate the normalized string
* representations of the DNs. It may be {@code null} if no
* schema is available.
*
* @return A negative integer if the first DN should come before the second
* DN in a sorted list, a positive integer if the first DN should
* come after the second DN in a sorted list, or zero if the two DN
* values can be considered equal.
*
* @throws LDAPException If either of the provided strings cannot be parsed
* as a DN.
*/
public static int compare(final String s1, final String s2,
final Schema schema)
throws LDAPException
{
return new DN(s1, schema).compareTo(new DN(s2, schema));
}
}
代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition
/**
* Compares the DNs with the provided string representations to determine
* their relative order in a sorted list.
*
* @param s1 The string representation for the first DN to be compared.
* It must not be {@code null}.
* @param s2 The string representation for the second DN to be compared.
* It must not be {@code null}.
* @param schema The schema to use to generate the normalized string
* representations of the DNs. It may be {@code null} if no
* schema is available.
*
* @return A negative integer if the first DN should come before the second
* DN in a sorted list, a positive integer if the first DN should
* come after the second DN in a sorted list, or zero if the two DN
* values can be considered equal.
*
* @throws LDAPException If either of the provided strings cannot be parsed
* as a DN.
*/
public static int compare(final String s1, final String s2,
final Schema schema)
throws LDAPException
{
return new DN(s1, schema).compareTo(new DN(s2, schema));
}
}
代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition
return parsedDN1.compareTo(parsedDN2);
内容来源于网络,如有侵权,请联系作者删除!