Class AttributeDeltaUtil
java.lang.Object
org.identityconnectors.framework.common.objects.AttributeDeltaUtil
Utility methods to retrieve values from instances of
AttributeDelta.-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 AttributeDeltafind(String name, Set<AttributeDelta> attrsDelta) Find theAttributeDeltaof the given name in theSet.static StringgetAsStringValue(AttributeDelta attrDelta) Get the string value from the specified (single-valued) attributeDelta.static AttributeDeltagetAttributeDeltaForName(Set<AttributeDelta> attrsDelta) Get theAttributeDeltaattributeDelta 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 BigDecimalgetBigDecimalValue(AttributeDelta attrDelta) Get the big decimal value from the specified (single-valued) attributeDelta.static BigIntegergetBigIntegerValue(AttributeDelta attrDelta) Get the big integer value from the specified (single-valued) attributeDelta.static BooleangetBooleanValue(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 BytegetByteValue(AttributeDelta attrDelta) Get the byte value from the specified (single-valued) attributeDelta.static CharactergetCharacterValue(AttributeDelta attrDelta) Get the character value from the specified (single-valued) attributeDelta.static GuardedStringgetCurrentPasswordValue(Set<AttributeDelta> attrsDelta) Get the current password value from the provided set ofAttributeDeltas.static DategetDateValue(AttributeDelta attrDelta) Get the date value from the specified (single-valued) attributeDelta that contains a long.static DoublegetDoubleValue(AttributeDelta attrDelta) Get the double value from the specified (single-valued) attributeDelta.static AttributegetEmptyAttribute(AttributeDelta attrDelta) Get theAttributeDeltawith name specific attributesDelta.static DategetEnableDate(Set<AttributeDelta> attrsDelta) Get the enable date from the set of attributesDelta.static FloatgetFloatValue(AttributeDelta attrDelta) Get the float value from the specified (single-valued) attributeDelta.static GuardedByteArraygetGuardedByteArrayValue(AttributeDelta attrDelta) Get theGuardedByteArrayvalue from the specified (single-valued) attributeDelta.static GuardedStringgetGuardedStringValue(AttributeDelta attrDelta) Get theGuardedStringvalue from the specified (single-valued) attributeDelta.static IntegergetIntegerValue(AttributeDelta attrDelta) Get the integer value from the specified (single-valued) attributeDelta.static LonggetLongValue(AttributeDelta attrDelta) Get the long value from the specified (single-valued) attributeDelta.getMapValue(AttributeDelta attrDelta) Get the map value from the specified (single-valued) attributeDelta.static BooleangetPasswordExpired(Set<AttributeDelta> attrsDelta) Get the password expired attributeDelta from aCollectionofAttributeDeltas.static GuardedStringgetPasswordValue(Set<AttributeDelta> attrsDelta) Get the password value from the provided set ofAttributeDeltas.static ObjectgetSingleValue(AttributeDelta attr) Get theObjectvalue 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 StringgetStringValue(AttributeDelta attrDelta) Get the string value from the specified (single-valued) attributeDelta.static AttributeDeltagetUidAttributeDelta(Set<AttributeDelta> attrsDelta) Get theAttributeDeltafrom the specified set of attributesDelta.static booleanisSpecial(AttributeDelta attrDelta) Determines whether the specified name of attribute info is for a special attribute.static booleanisSpecialName(String name) Determines whether the specified attribute name is special in the sense of.invalid reference
#createSpecialNamestatic booleannamesEqual(String name1, String name2) Compares two attributeDelta names for equality.static Map<String, AttributeDelta> toMap(Collection<? extends AttributeDelta> attributesDelta)
-
Method Details
-
getStringValue
Get the string value from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the string value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the string value from list valuesToReplace for the attributeDelta.
- Throws:
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.
-
getCharacterValue
Get the character value from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the character value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the character value from list valuesToReplace for the attributeDelta.
- Throws:
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.- Since:
- 1.4
-
getGuardedByteArrayValue
Get theGuardedByteArrayvalue from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the guarded byte array value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the guarded byte array value from list valuesToReplace for the attributeDelta.
- Throws:
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.- Since:
- 1.4
-
getGuardedStringValue
Get theGuardedStringvalue from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the guarded string value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the guarded string value from list valuesToReplace for the attributeDelta.
- Throws:
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.
-
getAsStringValue
Get the string value from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the string value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the string value from list valuesToReplace for the attributeDelta.
- Throws:
IllegalArgumentException- if the attributeDelta is a multi-valued (rather than single-valued) or valuesToReplace is null.
-
getByteValue
Get the byte value from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the byte value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the byte value from list valuesToReplace for the attributeDelta.
- Throws:
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.- Since:
- 1.4
-
getByteArrayValue
Get the byte array value from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the byte array value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the byte array value from list valuesToReplace for the attributeDelta.
- Throws:
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.- Since:
- 1.4
-
getIntegerValue
Get the integer value from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the integer value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the integer value from list valuesToReplace for the attributeDelta.
- Throws:
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.
-
getLongValue
Get the long value from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the long value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the long value from list valuesToReplace for the attributeDelta.
- Throws:
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.
-
getFloatValue
Get the float value from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the float value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the float value from list valuesToReplace for the attributeDelta.
- Throws:
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.- Since:
- 1.4
-
getDateValue
Get the date value from the specified (single-valued) attributeDelta that contains a long.- Parameters:
attrDelta- AttributeDelta from which to retrieve the date value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the date value from list valuesToReplace for the attributeDelta.
- Throws:
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.
-
getDoubleValue
Get the double value from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the double value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the double value from list valuesToReplace for the attributeDelta.
- Throws:
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.
-
getBigDecimalValue
Get the big decimal value from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the big decimal value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the big decimal value from list valuesToReplace for the attributeDelta.
- Throws:
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.
-
getBigIntegerValue
Get the big integer value from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the big integer value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the big integer value from list valuesToReplace for the attributeDelta.
- Throws:
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.- Since:
- 1.4
-
getBooleanValue
Get the boolean value from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the boolean value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the boolean value from list valuesToReplace for the attributeDelta.
- Throws:
ClassCastException- if the object in the attributeDelta is not anBoolean.IllegalArgumentException- if the attributeDelta is a multi-valued (rather than single-valued) or valuesToReplace is null.
-
getMapValue
Get the map value from the specified (single-valued) attributeDelta.- Parameters:
attrDelta- AttributeDelta from which to retrieve the map value.- Returns:
- null if the value is null or attributeDelta doesn't include valuesToReplace otherwise the map value from list valuesToReplace for the attributeDelta.
- Throws:
ClassCastException- if the object in the attributeDelta is not anMap.IllegalArgumentException- if the attributeDelta is a multi-valued (rather than single-valued) or valuesToReplace is null.
-
getSingleValue
Get theObjectvalue from the specified (single-valued) attributeDelta.- Returns:
nullif the attributeDelta's list of valuesToReplace isnullor empty.
-
toMap
public static Map<String,AttributeDelta> toMap(Collection<? extends AttributeDelta> attributesDelta) Transform aCollectionofAttributeDeltainstances into aMap. The key to each element in the map is the name of anAttributeDelta. The value of each element in the map is theAttributeDeltainstance with that name.- Parameters:
attributesDelta- set of attributesDelta to transform to a map.- Returns:
- a map of string and attributesDelta.
- Throws:
NullPointerException- if the parameter attributesDelta is null.
-
getUidAttributeDelta
Get theAttributeDeltafrom the specified set of attributesDelta.- Parameters:
attrsDelta- set ofAttributeDeltas that may contain aAttributeDeltawith.invalid reference
Uid.NAME- Returns:
- null if the set does not contain a
AttributeDeltawithor object the first one found.invalid reference
Uid.NAME
-
getEmptyAttribute
Get theAttributeDeltawith name specific attributesDelta.- Parameters:
attrDelta-AttributeDeltawith name from which createAttributeDelta.
-
getBasicAttributes
Filter out any special attributeDelta from the specified set. Special attributes includeName,Uid, andOperationalAttributes.- Parameters:
attrsDelta- set ofAttributeDeltas to filter out the operational and default attributes.- Returns:
- a set that only contains plain attributesDelta or empty.
-
getSpecialAttributes
Filter out any basic attributes from the specified set, leaving only special attributes. Special attributes includeName,Uid, andOperationalAttributes.- Parameters:
attrsDelta- set ofAttributeDeltas to filter out the basic attributes- Returns:
- a set that only contains special attributes or an empty set if there are none.
-
filterUid
Returns a mutable copy of the original set with the uid attributeDelta removed.- Parameters:
attrsDelta- The original set. Must not be null.- Returns:
- A mutable copy of the original set with the uid attributeDelta removed.
-
addUid
Returns a mutable copy of the original set with the uid attributeDelta added.- Parameters:
attrsDelta- The original set. Must not be null.values- The uid's values. Must not be null.- Returns:
- A mutable copy of the original set with the uid attributeDelta added.
-
isSpecial
Determines whether the specified name of attribute info is for a special attribute. Special attributes includeUid,ObjectClassandOperationalAttributes.- Parameters:
attr-AttributeInfoto test for against.- Returns:
- true if the attributeDelta name is name of a
Uid,ObjectClassor one of theOperationalAttributes. - Throws:
NullPointerException- if the attribute parameter is null.
-
isSpecialName
Determines whether the specified attribute name is special in the sense of.invalid reference
#createSpecialName- Parameters:
name- the attribute name to test against.- Returns:
- true if the attribute name is special.
-
namesEqual
Compares two attributeDelta names for equality.- Parameters:
name1- the first attributeDelta name.name2- the second attributeDelta name.- Returns:
- true if the two attributeDelta names are equal.
-
getAttributeDeltaForName
Get theAttributeDeltaattributeDelta for attribute Name from the specified set of attributesDelta.- Parameters:
attrsDelta- set of attributesDelta to search against.- Returns:
- the
AttributeDeltaattributeDelta for attribute Name if it exist otherwisenull.
-
find
Find theAttributeDeltaof the given name in theSet.- Parameters:
name-AttributeDelta's name to search for.attrsDelta-Setof attributeDelta to search.- Returns:
AttributeDeltawith the specified otherwisenull.
-
getPasswordValue
Get the password value from the provided set ofAttributeDeltas. -
getCurrentPasswordValue
Get the current password value from the provided set ofAttributeDeltas.- Parameters:
attrsDelta- Set ofAttributeDeltas that may contain the current passwordOperationalAttributes.CURRENT_PASSWORD_NAMEAttributeDelta.- Returns:
nullif it does not exist in theSetelse the value.
-
getPasswordExpired
Get the password expired attributeDelta from aCollectionofAttributeDeltas.- Parameters:
attrsDelta- set of attributeDelta to find the expired passwordAttributeDelta.- Returns:
nullif the attributeDelta does not exist and the value of theAttributeDeltaif it does.
-
getEnableDate
Get the enable date from the set of attributesDelta.- Parameters:
attrsDelta- set of attributeDelta to find the enable dateAttributeDelta.- Returns:
nullif the attributeDelta does not exist and the value of theAttributeDeltaif it does.
-