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

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

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

DN.isAncestorOf介绍

[英]Indicates whether this DN is an ancestor of the provided DN. It will be considered an ancestor of the provided DN if the array of RDN components for the provided DN ends with the elements that comprise the array of RDN components for this DN (i.e., if the provided DN is subordinate to, or optionally equal to, this DN). The null DN will be considered an ancestor for all other DNs (with the exception of the null DN if allowEqualsis false).
[中]指示此DN是否为所提供DN的祖先。如果所提供DN的RDN组件数组以构成该DN的RDN组件数组的元素结尾(即,如果所提供的DN从属于或可选地等于该DN),则该DN将被视为所提供DN的祖先。空DN将被视为所有其他DNs的祖先(如果allowEqualsis为false,则空DN除外)。

代码示例

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

/**
 * Indicates whether this DN is an ancestor of the DN with the provided string
 * representation.  It will be considered an ancestor of the provided DN if
 * the array of RDN components for the provided DN ends with the elements that
 * comprise the array of RDN components for this DN (i.e., if the provided DN
 * is subordinate to, or optionally equal to, this DN).  The null DN will be
 * considered an ancestor for all other DNs (with the exception of the null DN
 * if {@code allowEquals} is {@code false}).
 *
 * @param  s            The string representation of the DN for which to make
 *                      the determination.
 * @param  allowEquals  Indicates whether a DN should be considered an
 *                      ancestor of itself.
 *
 * @return  {@code true} if this DN may be considered an ancestor of the
 *          provided DN, or {@code false} if not.
 *
 * @throws  LDAPException  If the provided string cannot be parsed as a DN.
 */
public boolean isAncestorOf(final String s, final boolean allowEquals)
    throws LDAPException
{
 return isAncestorOf(new DN(s), allowEquals);
}

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

/**
 * Indicates whether this DN is an ancestor of the DN with the provided string
 * representation.  It will be considered an ancestor of the provided DN if
 * the array of RDN components for the provided DN ends with the elements that
 * comprise the array of RDN components for this DN (i.e., if the provided DN
 * is subordinate to, or optionally equal to, this DN).  The null DN will be
 * considered an ancestor for all other DNs (with the exception of the null DN
 * if {@code allowEquals} is {@code false}).
 *
 * @param  s            The string representation of the DN for which to make
 *                      the determination.
 * @param  allowEquals  Indicates whether a DN should be considered an
 *                      ancestor of itself.
 *
 * @return  {@code true} if this DN may be considered an ancestor of the
 *          provided DN, or {@code false} if not.
 *
 * @throws  LDAPException  If the provided string cannot be parsed as a DN.
 */
public boolean isAncestorOf(final String s, final boolean allowEquals)
    throws LDAPException
{
 return isAncestorOf(new DN(s), allowEquals);
}

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

/**
 * Indicates whether the DN represented by the first string is an ancestor of
 * the DN represented by the second string.  The first DN will be considered
 * an ancestor of the second DN if the array of RDN components for the first
 * DN ends with the elements that comprise the array of RDN components for the
 * second DN (i.e., if the first DN is subordinate to, or optionally equal to,
 * the second DN).  The null DN will be considered an ancestor for all other
 * DNs (with the exception of the null DN if {@code allowEquals} is
 * {@code false}).
 *
 * @param  s1           The string representation of the first DN for which to
 *                      make the determination.
 * @param  s2           The string representation of the second DN for which
 *                      to make the determination.
 * @param  allowEquals  Indicates whether a DN should be considered an
 *                      ancestor of itself.
 *
 * @return  {@code true} if the first DN may be considered an ancestor of the
 *          second DN, or {@code false} if not.
 *
 * @throws  LDAPException  If either of the provided strings cannot be parsed
 *                         as a DN.
 */
public static boolean isAncestorOf(final String s1, final String s2,
                  final boolean allowEquals)
    throws LDAPException
{
 return new DN(s1).isAncestorOf(new DN(s2), allowEquals);
}

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

/**
 * Indicates whether the DN represented by the first string is an ancestor of
 * the DN represented by the second string.  The first DN will be considered
 * an ancestor of the second DN if the array of RDN components for the first
 * DN ends with the elements that comprise the array of RDN components for the
 * second DN (i.e., if the first DN is subordinate to, or optionally equal to,
 * the second DN).  The null DN will be considered an ancestor for all other
 * DNs (with the exception of the null DN if {@code allowEquals} is
 * {@code false}).
 *
 * @param  s1           The string representation of the first DN for which to
 *                      make the determination.
 * @param  s2           The string representation of the second DN for which
 *                      to make the determination.
 * @param  allowEquals  Indicates whether a DN should be considered an
 *                      ancestor of itself.
 *
 * @return  {@code true} if the first DN may be considered an ancestor of the
 *          second DN, or {@code false} if not.
 *
 * @throws  LDAPException  If either of the provided strings cannot be parsed
 *                         as a DN.
 */
public static boolean isAncestorOf(final String s1, final String s2,
                  final boolean allowEquals)
    throws LDAPException
{
 return new DN(s1).isAncestorOf(new DN(s2), allowEquals);
}

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

parsedDN2 = e2.getParsedDN();
if (parsedDN1.isAncestorOf(parsedDN2, false))
else if (parsedDN2.isAncestorOf(parsedDN1, false))

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

break;
else if (restrictionDN.isAncestorOf(parsedBaseDN, false))
 break;
else if (restrictionDN.isAncestorOf(parsedBaseDN, false))

相关文章