public final class AttributeDeltaUtil extends Object
AttributeDelta
.Modifier and Type | Method and Description |
---|---|
static Set<AttributeDelta> |
addUid(Set<AttributeDelta> attrsDelta,
Object... values)
Returns a mutable copy of the original set with the uid attributeDelta added.
|
static Set<AttributeDelta> |
filterUid(Set<AttributeDelta> attrsDelta)
Returns a mutable copy of the original set with the uid attributeDelta
removed.
|
static AttributeDelta |
find(String name,
Set<AttributeDelta> attrsDelta)
Find the
AttributeDelta of the given name in the Set . |
static String |
getAsStringValue(AttributeDelta attrDelta)
Get the string value from the specified (single-valued) attributeDelta.
|
static AttributeDelta |
getAttributeDeltaForName(Set<AttributeDelta> attrsDelta)
Get the
AttributeDelta attributeDelta for attribute Name from the
specified set of attributesDelta. |
static Set<AttributeDelta> |
getBasicAttributes(Set<AttributeDelta> attrsDelta)
Filter out any special attributeDelta from the specified set.
|
static BigDecimal |
getBigDecimalValue(AttributeDelta attrDelta)
Get the big decimal value from the specified (single-valued) attributeDelta.
|
static BigInteger |
getBigIntegerValue(AttributeDelta attrDelta)
Get the big integer value from the specified (single-valued) attributeDelta.
|
static Boolean |
getBooleanValue(AttributeDelta attrDelta)
Get the boolean value from the specified (single-valued) attributeDelta.
|
static Byte[] |
getByteArrayValue(AttributeDelta attrDelta)
Get the byte array value from the specified (single-valued) attributeDelta.
|
static Byte |
getByteValue(AttributeDelta attrDelta)
Get the byte value from the specified (single-valued) attributeDelta.
|
static Character |
getCharacterValue(AttributeDelta attrDelta)
Get the character value from the specified (single-valued) attributeDelta.
|
static GuardedString |
getCurrentPasswordValue(Set<AttributeDelta> attrsDelta)
Get the current password value from the provided set of
AttributeDelta
s. |
static Date |
getDateValue(AttributeDelta attrDelta)
Get the date value from the specified (single-valued) attributeDelta that
contains a long.
|
static Double |
getDoubleValue(AttributeDelta attrDelta)
Get the double value from the specified (single-valued) attributeDelta.
|
static Attribute |
getEmptyAttribute(AttributeDelta attrDelta)
Get the
AttributeDelta with name specific attributesDelta. |
static Date |
getEnableDate(Set<AttributeDelta> attrsDelta)
Get the enable date from the set of attributesDelta.
|
static Float |
getFloatValue(AttributeDelta attrDelta)
Get the float value from the specified (single-valued) attributeDelta.
|
static GuardedByteArray |
getGuardedByteArrayValue(AttributeDelta attrDelta)
Get the
GuardedByteArray value from the specified (single-valued)
attributeDelta. |
static GuardedString |
getGuardedStringValue(AttributeDelta attrDelta)
Get the
GuardedString value from the specified (single-valued)
attributeDelta. |
static Integer |
getIntegerValue(AttributeDelta attrDelta)
Get the integer value from the specified (single-valued) attributeDelta.
|
static Long |
getLongValue(AttributeDelta attrDelta)
Get the long value from the specified (single-valued) attributeDelta.
|
static Map<String,Object> |
getMapValue(AttributeDelta attrDelta)
Get the map value from the specified (single-valued) attributeDelta.
|
static Boolean |
getPasswordExpired(Set<AttributeDelta> attrsDelta)
Get the password expired attributeDelta from a
Collection of
AttributeDelta s. |
static GuardedString |
getPasswordValue(Set<AttributeDelta> attrsDelta)
Get the password value from the provided set of
AttributeDelta s. |
static Object |
getSingleValue(AttributeDelta attr)
Get the
Object value from the specified (single-valued)
attributeDelta. |
static Set<AttributeDelta> |
getSpecialAttributes(Set<AttributeDelta> attrsDelta)
Filter out any basic attributes from the specified set, leaving only
special attributes.
|
static String |
getStringValue(AttributeDelta attrDelta)
Get the string value from the specified (single-valued) attributeDelta.
|
static AttributeDelta |
getUidAttributeDelta(Set<AttributeDelta> attrsDelta)
Get the
AttributeDelta from the specified set of attributesDelta. |
static boolean |
isSpecial(AttributeDelta attrDelta)
Determines whether the specified name of attribute info is for a special
attribute.
|
static boolean |
isSpecialName(String name)
Determines whether the specified attribute name is special in the sense
of
#createSpecialName . |
static boolean |
namesEqual(String name1,
String name2)
Compares two attributeDelta names for equality.
|
static Map<String,AttributeDelta> |
toMap(Collection<? extends AttributeDelta> attributesDelta)
|
public static String getStringValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the string value.ClassCastException
- if the object in the attributeDelta is not a string.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static Character getCharacterValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the character value.ClassCastException
- if the object in the attributeDelta is not a character.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static GuardedByteArray getGuardedByteArrayValue(AttributeDelta attrDelta)
GuardedByteArray
value from the specified (single-valued)
attributeDelta.attrDelta
- AttributeDelta from which to retrieve the guarded byte array value.ClassCastException
- if the object in the attributeDelta is not a GuardedByteArray.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static GuardedString getGuardedStringValue(AttributeDelta attrDelta)
GuardedString
value from the specified (single-valued)
attributeDelta.attrDelta
- AttributeDelta from which to retrieve the guarded string value.ClassCastException
- if the object in the attributeDelta is not a GuardedString.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static String getAsStringValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the string value.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static Byte getByteValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the byte value.ClassCastException
- if the object in the attributeDelta is not a byte.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static Byte[] getByteArrayValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the byte array value.ClassCastException
- if the object in the attributeDelta is not a byte array.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static Integer getIntegerValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the integer value.ClassCastException
- if the object in the attributeDelta is not an integer.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static Long getLongValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the long value.ClassCastException
- if the object in the attributeDelta is not a long.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static Float getFloatValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the float value.ClassCastException
- if the object in the attributeDelta is not a float.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static Date getDateValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the date value.ClassCastException
- if the object in the attributeDelta is not a long.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static Double getDoubleValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the double value.ClassCastException
- if the object in the attributeDelta is not a double.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static BigDecimal getBigDecimalValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the big decimal value.ClassCastException
- if the object in the attributeDelta is not a big decimal.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static BigInteger getBigIntegerValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the big integer value.ClassCastException
- if the object in the attributeDelta is not a big integer.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static Boolean getBooleanValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the boolean value.ClassCastException
- if the object in the attributeDelta is not an Boolean
.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static Map<String,Object> getMapValue(AttributeDelta attrDelta)
attrDelta
- AttributeDelta from which to retrieve the map value.ClassCastException
- if the object in the attributeDelta is not an Map
.IllegalArgumentException
- if the attributeDelta is a multi-valued (rather than
single-valued) or valuesToReplace is null.public static Object getSingleValue(AttributeDelta attr)
Object
value from the specified (single-valued)
attributeDelta.null
if the attributeDelta's list of valuesToReplace is
null
or empty.public static Map<String,AttributeDelta> toMap(Collection<? extends AttributeDelta> attributesDelta)
Collection
of AttributeDelta
instances
into a Map
.
The key to each element in the map is the name of an
AttributeDelta
. The value of each element in the map is the
AttributeDelta
instance with that name.attributesDelta
- set of attributesDelta to transform to a map.NullPointerException
- if the parameter attributesDelta is
null.public static AttributeDelta getUidAttributeDelta(Set<AttributeDelta> attrsDelta)
AttributeDelta
from the specified set of attributesDelta.attrsDelta
- set of AttributeDelta
s that may contain a
AttributeDelta
with Uid.NAME
.AttributeDelta
with
Uid.NAME
or object the first one found.public static Attribute getEmptyAttribute(AttributeDelta attrDelta)
AttributeDelta
with name specific attributesDelta.attrDelta
- AttributeDelta
with name from which create AttributeDelta
.public static Set<AttributeDelta> getBasicAttributes(Set<AttributeDelta> attrsDelta)
Name
, Uid
, and
OperationalAttributes
.attrsDelta
- set of AttributeDelta
s to filter out the operational
and default attributes.public static Set<AttributeDelta> getSpecialAttributes(Set<AttributeDelta> attrsDelta)
Name
, Uid
, and
OperationalAttributes
.attrsDelta
- set of AttributeDelta
s to filter out the basic
attributespublic static Set<AttributeDelta> filterUid(Set<AttributeDelta> attrsDelta)
attrsDelta
- The original set. Must not be null.public static Set<AttributeDelta> addUid(Set<AttributeDelta> attrsDelta, Object... values)
attrsDelta
- The original set. Must not be null.values
- The uid's values. Must not be null.public static boolean isSpecial(AttributeDelta attrDelta)
Uid
, ObjectClass
and OperationalAttributes
.attr
- AttributeInfo
to test for against.Uid
, ObjectClass
or one of the OperationalAttributes
.NullPointerException
- if the attribute parameter is null.public static boolean isSpecialName(String name)
#createSpecialName
.name
- the attribute name to test against.public static boolean namesEqual(String name1, String name2)
name1
- the first attributeDelta name.name2
- the second attributeDelta name.public static AttributeDelta getAttributeDeltaForName(Set<AttributeDelta> attrsDelta)
AttributeDelta
attributeDelta for attribute Name from the
specified set of attributesDelta.attrsDelta
- set of attributesDelta to search against.AttributeDelta
attributeDelta for attribute Name if
it exist otherwise null
.public static AttributeDelta find(String name, Set<AttributeDelta> attrsDelta)
AttributeDelta
of the given name in the Set
.name
- AttributeDelta
's name to search for.attrsDelta
- Set
of attributeDelta to search.AttributeDelta
with the specified otherwise
null
.public static GuardedString getPasswordValue(Set<AttributeDelta> attrsDelta)
AttributeDelta
s.public static GuardedString getCurrentPasswordValue(Set<AttributeDelta> attrsDelta)
AttributeDelta
s.attrsDelta
- Set of AttributeDelta
s that may contain the current
password OperationalAttributes.CURRENT_PASSWORD_NAME
AttributeDelta
.null
if it does not exist in the Set
else
the value.public static Boolean getPasswordExpired(Set<AttributeDelta> attrsDelta)
Collection
of
AttributeDelta
s.attrsDelta
- set of attributeDelta to find the expired password
AttributeDelta
.null
if the attributeDelta does not exist and the value
of the AttributeDelta
if it does.public static Date getEnableDate(Set<AttributeDelta> attrsDelta)
attrsDelta
- set of attributeDelta to find the enable date
AttributeDelta
.null
if the attributeDelta does not exist and the
value of the AttributeDelta
if it does.Copyright © 2019. All rights reserved.