public class Attr extends Object implements Serializable, Cloneable
Constructor and Description |
---|
Attr()
Default constructor
|
Attr(org.forgerock.opendj.ldap.Attribute attr)
Construct an attribute based on a LDAP attribute
|
Attr(String name)
Constructs an attribute value pair with no value.
|
Attr(String name,
byte[] value)
Constructs an attribute value pair with byte array.
|
Attr(String name,
byte[][] value)
Constructs an attribute value pair with array of byte array.
|
Attr(String name,
String value)
Construct an attribute value pair with a single string value.
|
Attr(String name,
String[] value)
Construct an attribute value pair with a multiple string values.
|
Modifier and Type | Method and Description |
---|---|
void |
addValue(byte[] value)
Add a byte array value to the attribute
|
void |
addValue(String value)
Add a string value to the attribute
|
void |
addValues(byte[][] values)
Add a list byte array values to the attribute
|
void |
addValues(String[] values)
Add mulitple string values to the attribute
|
Object |
clone()
Return a copy of the object
|
boolean |
contains(byte[] value)
Checks whether the given value already exist for
the attribute
|
boolean |
contains(String value)
Checks whether the given value already exist for
the attribute
|
String |
getBaseName()
Get base name for the attribute. e.g, the base name
of "cn;lang-en" or "cn;lang-ja" is "cn"
|
static String |
getBaseName(String attrName)
Get base name for an attribute name. e.g, the base
name of "cn;lang-en" or "cn;lang-ja" is "cn"
|
byte[] |
getByteValue()
Get one byte[] value of the attribute Returning a
colletion would be better, but will not be consistent with the method
getStringValues()
|
byte[][] |
getByteValues()
Get the byte[] values of the attribute
|
String |
getName()
Get name of an UMS attribute
|
String |
getName(Locale locale)
Get name of attribute in a given Locale
|
static String |
getName(String attrName,
Locale locale)
Get attribute name with locale input.
|
String[] |
getStringValues()
Get the string values of the attribute
|
String |
getValue()
Get one string value of the attribute
|
void |
removeValue(byte[] value)
Remove a specified string value in the attribute
|
void |
removeValue(String value)
Remove a specified string value in the attribute
|
void |
setValue(byte[] value)
Set value of an attribute
|
void |
setValue(String value)
Set value of an attribute
|
int |
size()
Get the number of values of the attribute
|
org.forgerock.opendj.ldap.Attribute |
toLDAPAttribute()
Map to a ldap attribute
|
String |
toString()
Retrieves the string representation of an attribute
|
public Attr()
public Attr(String name)
name
- attribute namepublic Attr(String name, String value)
name
- the name of attributevalue
- string value of attributepublic Attr(String name, String[] value)
name
- the name of attributevalue
- multiple string values of attributepublic Attr(String name, byte[] value)
name
- attribute namevalue
- byte array as input for valuepublic Attr(String name, byte[][] value)
name
- attribute namevalue
- array of byte array as input for valuepublic Attr(org.forgerock.opendj.ldap.Attribute attr)
attr
- ldap attribute to construct frompublic org.forgerock.opendj.ldap.Attribute toLDAPAttribute()
public void setValue(String value)
value
- the attribute value to be setpublic void addValue(String value)
value
- value to be added to the attributepublic void addValues(String[] values)
values
- string values to be added to the attributepublic void removeValue(String value)
value
- specified value to be remvoed from the value arraypublic void setValue(byte[] value)
value
- the attribute value to be setpublic void addValue(byte[] value)
value
- byte array value to be added to the attributepublic void addValues(byte[][] values)
values
- of byte array values to be added to the attributepublic void removeValue(byte[] value)
value
- specified value to be remvoed from the value arraypublic String getName()
public String getName(Locale locale)
locale
- Given locale for the attribute name to returnpublic static String getName(String attrName, Locale locale)
attrName
- name of the attributelocale
- desired locale for the attributepublic String getBaseName()
public static String getBaseName(String attrName)
public String getValue()
public String[] getStringValues()
public boolean contains(String value)
value
- the value to check fortrue
if the value already exists,
false
otherwisepublic byte[] getByteValue()
public byte[][] getByteValues()
public boolean contains(byte[] value)
value
- the value to check fortrue
if the value already exists,
false
otherwisepublic int size()
public Object clone()
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.