|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.util.AttributeUtils
public class AttributeUtils
A set of utility fuctions for working with Attributes.
Constructor Summary | |
---|---|
AttributeUtils()
|
Method Summary | |
---|---|
static Object |
cloneValue(Object value)
Clone the value. |
static boolean |
containsAnyValues(Attribute attr,
Object[] compared,
AttributeType type)
|
static boolean |
containsValue(Attribute attr,
Object compared,
AttributeType type)
|
static boolean |
containsValueCaseIgnore(Attribute attr,
Object value)
Check if an attribute contains a value. |
static boolean |
equals(Object value1,
Object value2)
Compare two values and return true if they are equal. |
static Attribute |
getAttribute(Attributes attrs,
AttributeType type)
Utility method to extract an attribute from Attributes object using all combinationos of the name including aliases. |
static Attribute |
getAttribute(ModificationItemImpl[] mods,
AttributeType type)
Utility method to extract an attribute from an array of modifications. |
static Attribute |
getDifference(Attribute attr0,
Attribute attr1)
Creates a new attribute which contains the values representing the difference of two attributes. |
static Attribute |
getUnion(Attribute attr0,
Attribute attr1)
Creates a new attribute which contains the values representing the union of two attributes. |
static Attribute |
toAttributeImpl(Attribute attribute)
Switch from a BasicAttribute to a LockableAttributeImpl. |
static Attributes |
toAttributesImpl(Attributes attributes)
Switch from a BasicAttributes to a LockableAttributesImpl. |
static String |
toString(Attribute attribute)
Return a string representing the attributes |
static String |
toString(Attributes attributes)
Return a string representing the attributes |
static String |
toString(String tabs,
Attribute attribute)
Return a string representing the attributes with tabs in front of the string |
static String |
toString(String tabs,
Attributes attributes)
Return a string representing the attributes with tabs in front of the string |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttributeUtils()
Method Detail |
---|
public static final boolean equals(Object value1, Object value2)
value1
- The first valuevalue2
- The second value
public static final Object cloneValue(Object value)
value
- The value to clone
public static final Attribute toAttributeImpl(Attribute attribute)
attribute
- The attribute to transform
public static final Attributes toAttributesImpl(Attributes attributes)
attributes
- The attributes to transform
public static final Attribute getAttribute(Attributes attrs, AttributeType type)
attrs
- the Attributes to get the Attribute object fromtype
- the attribute type specification
public static final Attribute getAttribute(ModificationItemImpl[] mods, AttributeType type)
mods
- the array of ModificationItems to extract the Attribute from.type
- the attributeType spec of the Attribute to extract
public static final boolean containsValue(Attribute attr, Object compared, AttributeType type) throws NamingException
NamingException
public static final boolean containsValueCaseIgnore(Attribute attr, Object value)
attr
- The attribute to checkvalue
- The value to look for
NamingException
public static boolean containsAnyValues(Attribute attr, Object[] compared, AttributeType type) throws NamingException
NamingException
public static Attribute getDifference(Attribute attr0, Attribute attr1) throws NamingException
IllegalArgumentException
is
raised. Note that the order of arguments makes a difference.
attr0
- the first attributeattr1
- the second attribute
NamingException
- if there are problems accessing attribute valuespublic static Attribute getUnion(Attribute attr0, Attribute attr1) throws NamingException
IllegalArgumentException
is raised.
attr0
- the first attributeattr1
- the second attribute
NamingException
- if there are problems accessing attribute valuespublic static String toString(String tabs, Attribute attribute)
tabs
- Spaces to be added before the stringattributes
- The attributes to print
public static String toString(Attribute attribute)
attributes
- The attributes to print
public static String toString(String tabs, Attributes attributes)
tabs
- Spaces to be added before the stringattributes
- The attributes to print
public static String toString(Attributes attributes)
attributes
- The attributes to print
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |