Class AttrValueSupport
java.lang.Object
org.sourceid.saml20.adapter.attribute.AttrValueSupport
A helper class to make and convert an
AttributeValue.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckSetMasked(Map<String, AttributeValue> attrMap, Set<String> maskedKeySet) Updates the specifiedAttributeMapby updating each masked flag depending on the maskedKeySet.static AttributeMapConverts the specified map to anAttributeMapby callingmake(Object)on each map value.static AttributeMapConverts the specified map to anAttributeMapby callingmake(Object, boolean)on each map value.static AttributeMapconvert(Map<String, Object> srcMap, boolean maskAll, Set<String> maskedKeySet, boolean maskOgnlValues) static AttributeMapConverts the specified map to anAttributeMapby callingmake(Object, boolean)on each map value.static AttributeValueCreates anAttributeValuefrom the String representation of the specified object.static AttributeValueCreates anAttributeValuefrom the String representation of the specified object.static AttributeValuemake(Collection<?> objs) Creates anAttributeValuefrom the Collection of objects.static AttributeValuemake(Collection<?> objs, boolean trimValues) Creates anAttributeValuefrom the Collection of objects.static voidsetMasked(AttributeValue attributeValue) Helper method to set the specified attribute value's masked flag to true.static AttributeMapsetMasked(AttributeMap srcMap, Set<String> maskedKeySet, boolean maskOgnlValues) Returns a newAttributeMapwith each of itsAttributeValueupdated with the appropriate mask setting.
-
Constructor Details
-
AttrValueSupport
public AttrValueSupport()
-
-
Method Details
-
make
Creates anAttributeValuefrom the String representation of the specified object. The String representation is not trimmed.- Parameters:
obj- The value of the returnedAttributeValue.- Returns:
- A new
AttributeValueor obj if obj is an instance ofAttributeValue.
-
make
Creates anAttributeValuefrom the String representation of the specified object.- Parameters:
obj- The value of the returnedAttributeValue.trim- Whether the value should be trimmed.- Returns:
- A new
AttributeValueor obj if obj is an instance ofAttributeValue.
-
make
Creates anAttributeValuefrom the Collection of objects. The String representation each object is added as a value. The String representations are not trimmed.- Parameters:
objs- The values of the returnedAttributeValue.- Returns:
- A new
AttributeValue.
-
make
Creates anAttributeValuefrom the Collection of objects. The String representation each object is added as a value.- Parameters:
objs- The values of the returnedAttributeValue.trimValues- Whether the values should be trimmed.- Returns:
- A new
AttributeValue.
-
convert
Converts the specified map to anAttributeMapby callingmake(Object)on each map value. Ognl values are not masked.- Parameters:
srcMap- The map to convert.maskAll- Whether all the values should be masked.- Returns:
- A new
AttributeMap.
-
convert
Converts the specified map to anAttributeMapby callingmake(Object, boolean)on each map value. Ognl values are not masked.- Parameters:
srcMap- The map to convert.maskAll- Whether all the values should be masked.trim- Whether or not each value should be trimmed.- Returns:
- A new
AttributeMap.
-
convert
public static AttributeMap convert(Map<String, Object> srcMap, Set<String> maskedKeySet, boolean maskOgnlValues) Converts the specified map to anAttributeMapby callingmake(Object, boolean)on each map value. Ognl values are not masked.- Parameters:
srcMap- The map to convert.maskedKeySet- A set of field names that should have their values masked.maskOgnlValues- Whether all the values should be masked.- Returns:
- A new
AttributeMap.
-
setMasked
public static AttributeMap setMasked(AttributeMap srcMap, Set<String> maskedKeySet, boolean maskOgnlValues) Returns a newAttributeMapwith each of itsAttributeValueupdated with the appropriate mask setting.- Parameters:
srcMap- The sourceAttributeMap.maskedKeySet- A set of attribute names, whose values should be masked.maskOgnlValues- Whether or not the mask the Ognl values.- Returns:
- A new
AttributeMapwith the appropriate masked flags.
-
convert
-
checkSetMasked
Updates the specifiedAttributeMapby updating each masked flag depending on the maskedKeySet.- Parameters:
attrMap- TheAttributeMapto be updated.maskedKeySet- A set of attribute names, whose values should be masked. For any values not in this set the masked flag is cleared.
-
setMasked
Helper method to set the specified attribute value's masked flag to true.- Parameters:
attributeValue- The attribute value to mask.
-