com.unboundid.ldap.sdk.Attribute.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(117)

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

Attribute.<init>介绍

[英]Creates a new LDAP attribute with the specified name and no values.
[中]使用指定的名称创建新的LDAP属性,但不使用任何值。

代码示例

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

/**
  * Retrieves an attribute that is equivalent to this compact attribute.
  *
  * @return  An attribute that is equivalent to this compact attribute.
  */
 Attribute toAttribute()
 {
  return new Attribute(name, values);
 }
}

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

/**
 * Creates a new LDAP attribute with the specified name and value.
 *
 * @param  attrName   The name for this attribute.
 * @param  attrBytes  The value for this attribute.
 */
public LDAPAttribute(final String attrName, final byte[] attrBytes)
{
 attribute = new Attribute(attrName, attrBytes);
}

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

/**
 * Creates a new LDAP attribute with the specified name and values.
 *
 * @param  attrName     The name for this attribute.
 * @param  attrStrings  The values for this attribute.
 */
public LDAPAttribute(final String attrName, final String[] attrStrings)
{
 attribute = new Attribute(attrName, attrStrings);
}

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

/**
 * Creates a new LDAP attribute with the specified name and no values.
 *
 * @param  attrName  The name for this attribute.
 */
public LDAPAttribute(final String attrName)
{
 attribute = new Attribute(attrName);
}

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

/**
  * Retrieves an attribute that is equivalent to this compact attribute.
  *
  * @return  An attribute that is equivalent to this compact attribute.
  */
 Attribute toAttribute()
 {
  return new Attribute(name, values);
 }
}

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

/**
 * Creates a new LDAP attribute with the specified name and value.
 *
 * @param  attrName    The name for this attribute.
 * @param  attrString  The value for this attribute.
 */
public LDAPAttribute(final String attrName, final String attrString)
{
 attribute = new Attribute(attrName, attrString);
}

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

/**
 * {@inheritDoc}
 */
@Override()
protected List<Attribute> getAdditionalAttributes()
{
 return Arrays.asList(new Attribute(ATTR_BACKEND_ID, backendID));
}

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

/**
 * {@inheritDoc}
 */
@Override()
protected List<Attribute> getAdditionalAttributes()
{
 return Arrays.asList(new Attribute(ATTR_SCHEMA_FILE, schemaFileNames));
}

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

/**
  * Converts this LDIF attribute to an SDK attribute.
  *
  * @return  An SDK attribute with the name and values of this LDIF attribute.
  */
 Attribute toAttribute()
 {
  final ASN1OctetString[] valueArray = new ASN1OctetString[values.size()];
  values.toArray(valueArray);

  return new Attribute(name, matchingRule, valueArray);
 }
}

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

/**
 * {@inheritDoc}
 */
@Override()
protected List<Attribute> getAdditionalAttributes()
{
 final ArrayList<Attribute> attrs = new ArrayList<Attribute>(1);
 if(reason != null)
 {
  attrs.add(new Attribute(ATTR_LEAVE_LOCKDOWN_REASON, reason));
 }
 return attrs;
}

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

/**
  * Converts this LDIF attribute to an SDK attribute.
  *
  * @return  An SDK attribute with the name and values of this LDIF attribute.
  */
 Attribute toAttribute()
 {
  final ASN1OctetString[] valueArray = new ASN1OctetString[values.size()];
  values.toArray(valueArray);

  return new Attribute(name, matchingRule, valueArray);
 }
}

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

/**
 * Retrieves the attribute for this modification.
 *
 * @return  The attribute for this modification.
 */
public Attribute getAttribute()
{
 return new Attribute(attributeName,
            CaseIgnoreStringMatchingRule.getInstance(), values);
}

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

/**
 * Retrieves the attribute for this modification.
 *
 * @return  The attribute for this modification.
 */
public Attribute getAttribute()
{
 return new Attribute(attributeName,
            CaseIgnoreStringMatchingRule.getInstance(), values);
}

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

/**
 * Adds the provided value to the set of values for this attribute.
 *
 * @param  attrString  The value to add to this attribute.
 */
public void addValue(final String attrString)
{
 attribute = Attribute.mergeAttributes(attribute,
    new Attribute(attribute.getName(), attrString));
}

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

/**
 * Adds the provided value to the set of values for this attribute.
 *
 * @param  attrBytes  The value to add to this attribute.
 */
public void addValue(final byte[] attrBytes)
{
 attribute = Attribute.mergeAttributes(attribute,
    new Attribute(attribute.getName(), attrBytes));
}

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

/**
 * Adds the provided attribute to the entry to add.
 *
 * @param  name    The name of the attribute to add.  It must not be
 *                 {@code null}.
 * @param  values  The set of values for the attribute to add.  It must not be
 *                 {@code null}.
 */
public void addAttribute(final String name, final String... values)
{
 ensureNotNull(name, values);
 addAttribute(new Attribute(name, values));
}

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

/**
 * Removes the provided value from this attribute.
 *
 * @param  attrValue  The value to remove.
 */
public void removeValue(final String attrValue)
{
 attribute = Attribute.removeValues(attribute,
    new Attribute(attribute.getName(), attrValue));
}

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

/**
 * Removes the provided value from this attribute.
 *
 * @param  attrValue  The value to remove.
 */
public void removeValue(final byte[] attrValue)
{
 attribute = Attribute.removeValues(attribute,
    new Attribute(attribute.getName(), attrValue));
}

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

/**
 * Adds the provided attribute to the entry to add.
 *
 * @param  name    The name of the attribute to add.  It must not be
 *                 {@code null}.
 * @param  values  The set of values for the attribute to add.  It must not be
 *                 {@code null}.
 */
public void addAttribute(final String name, final byte[]... values)
{
 ensureNotNull(name, values);
 addAttribute(new Attribute(name, values));
}

代码示例来源:origin: otto-de/edison-microservice

private LDAPInterface someLdapInterfaceReturning(String... roles) throws LDAPSearchException {
    final LDAPInterface ldap = mock(LDAPInterface.class);
    final List<SearchResultEntry> entries = singletonList(
        new SearchResultEntry("", singleton(new Attribute("cn", roles))));
    final SearchResult searchResult = new SearchResult(0, null, null, null, null, entries, emptyList(), 1, 0, null);
    when(ldap.search(any(SearchRequest.class))).thenReturn(searchResult);
    return ldap;
  }
}

相关文章