Class AttributeValue
java.lang.Object
org.sourceid.saml20.adapter.attribute.AttributeValue
- All Implemented Interfaces:
Serializable
A representation of the value(s) of an attribute. This class is intended to allow for multi-valued attributes
yet still enable simple usage of single-valued attributes.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAttributeValue(String value) AttributeValue(Collection<String> values) AttributeValue(Collection<String> strVals, Collection<?> objVals) AttributeValue(AttributeValue copyFrom) -
Method Summary
Modifier and TypeMethodDescriptionGets all the values for this attribute as raw objects.Gets the value of this attribute as a raw object.getValue()Gets the value of this attribute.getValue(boolean enforceMasking) Gets the value of this attribute.Gets the value of this attribute.Gets the value of this attribute.Gets all the values for this attribute.Gets all the values for this attribute.Returns the values as aHashSet.booleanDetermines if this attribute value has the indicated value.booleanisMasked()Has this attribute value been flagged as masked?booleanDetermines if this is a multi-valued attribute.If this is considered a 'masked' attribute (because it contains sensitive user info), the actual value of the attribute will be concealed with this method only.voidsetMasked(boolean masked) Set whether or not this AttributeValue should be masked.toString()If this is a single value attribute, this method returns that value.
-
Constructor Details
-
AttributeValue
public AttributeValue() -
AttributeValue
-
AttributeValue
-
AttributeValue
-
AttributeValue
-
-
Method Details
-
isMultiValue
public boolean isMultiValue()Determines if this is a multi-valued attribute. Returns true ifgetValues()would return an Iterable having more than one item.- Returns:
- True if this is a multi-valued attribute, false otherwise.
-
getValue
Gets the value of this attribute. If this is a multi-valued attribute, the first value will be returned. Note that this method can return null.- Returns:
- The first value of this attribute value or null is there is no value.
-
getValue
Gets the value of this attribute. If this is a multi-valued attribute, the first value will be returned. Note that this method can return null.- Returns:
- The first value of this attribute value or null is there is no value.
-
getValue
Gets the value of this attribute. If this is a multi-valued attribute, the first value will be returned. If there is no value for the attribute the nullMask parameter will be returned.- Parameters:
nullMask-- Returns:
- The first value of this attribute value or nullMask is there is no value.
-
getValueMaskNull
Gets the value of this attribute. If this is a multi-valued attribute, the first value will be returned. If there is no value for the attribute an empty string will be returned.- Returns:
- The first value of this attribute value or an empty string is there is no value.
-
getValues
Gets all the values for this attribute. This method will never return null but may return an Iterable that is empty.- Returns:
- An all the values of this attribute as an Iterable of Strings.
-
getValuesAsCollection
Gets all the values for this attribute. This method will never return null but may return a Collectionthat is empty. - Returns:
- An all the values of this attribute as a Collection of Strings.
-
hasValue
Determines if this attribute value has the indicated value.- Parameters:
value- the value of interest.- Returns:
- True if any of the values for this attribute match the given parameter, false otherwise.
-
getAllObjectValues
Gets all the values for this attribute as raw objects. This method will never return null but may return an Iterable that is empty.- Returns:
- An all the values of this attribute as an Iterable.
-
getObjectValue
Gets the value of this attribute as a raw object. If this is a multi-valued attribute, the first value will be returned. Note that this method can return null.- Returns:
- The first value of this attribute value or null is there is no value.
-
toString
If this is a single value attribute, this method returns that value. If it is a multi-valued attribute, a string representing all values [value1, value2, value3] is returned. -
sensitiveToString
If this is considered a 'masked' attribute (because it contains sensitive user info), the actual value of the attribute will be concealed with this method only. -
isMasked
public boolean isMasked()Has this attribute value been flagged as masked?- Returns:
- True if this is considered a sensitive attribute value that should not be logged.
-
setMasked
public void setMasked(boolean masked) Set whether or not this AttributeValue should be masked.- Parameters:
masked- Whether or not this AttributeValue should be masked.
-
getValuesAsHashSet
Returns the values as aHashSet.- Returns:
- The values as a
HashSet.
-