Package net.shibboleth.idp.attribute
Class IdPAttribute
java.lang.Object
net.shibboleth.idp.attribute.IdPAttribute
- All Implemented Interfaces:
Cloneable
,Comparable<IdPAttribute>
- Direct Known Subclasses:
IdPRequestedAttribute
@NotThreadSafe
public class IdPAttribute
extends Object
implements Comparable<IdPAttribute>, Cloneable
Each attribute represents one piece of information about a user and has associated encoders used to turn that
information in to protocol-specific formats.
Instances of
IdPAttribute
are compared using their IDs. That is, two attributes are considered the same if
they have the same ID, regardless of whether their display names, descriptions, values, or encoders are the same.-
Field Summary
FieldsModifier and TypeFieldDescriptionLocalized human readable descriptions of attribute.Localized human intelligible attribute names.Helper Function for map manipulation.private final String
ID of this attribute.private static final org.slf4j.Logger
Logger - static.Value for testing illegal name.private List<IdPAttributeValue>
Values for this attribute. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckedNamesFrom
(Map<Locale, String> inputMap) Process input tosetDisplayNames(Map)
and {setDisplayDescriptions(Map)
to strip out null input, null keys, and null values.clone()
Clones an attribute.int
compareTo
(IdPAttribute other) boolean
Check for a string value amongst this object's value collection.boolean
Deprecated, for removal: This API element is subject to removal in a future version.These values should be calculated at point of useDeprecated, for removal: This API element is subject to removal in a future version.These values should be calculated at point of usegetId()
Gets the unique ID of the attribute.Get the unmodifiable ordered collection of values of the attribute.int
hashCode()
static boolean
isDeprecatedId
(String id) Centralized method to police deprecated Identifiers.static boolean
isInvalidId
(String id) Centralized method to police invalid Identifiers.void
setDisplayDescriptions
(Map<Locale, String> newDescriptions) Deprecated, for removal: This API element is subject to removal in a future version.These values should be calculated at point of usevoid
setDisplayNames
(Map<Locale, String> newNames) Deprecated, for removal: This API element is subject to removal in a future version.These values should be calculated at point of usevoid
setValues
(Collection<IdPAttributeValue> newValues) Replaces the existing values for this attribute with the given values.toString()
-
Field Details
-
SPACE_CONTAINING
Value for testing illegal name. -
LOG
@Nonnull private static final org.slf4j.Logger LOGLogger - static. -
filterEntry
Helper Function for map manipulation. -
id
ID of this attribute. -
displayNames
Localized human intelligible attribute names. -
displayDescriptions
Localized human readable descriptions of attribute. -
values
Values for this attribute.
-
-
Constructor Details
-
IdPAttribute
Constructor.- Parameters:
attributeId
- unique identifier of the attribute
-
-
Method Details
-
isDeprecatedId
Centralized method to police deprecated Identifiers.- Parameters:
id
- what to test- Returns:
- whether the name is currently deprecated.
-
isInvalidId
Centralized method to police invalid Identifiers.- Parameters:
id
- what to test- Returns:
- whether the name is disallowed.
-
getId
Gets the unique ID of the attribute. This ID need not be related to any protocol-specific attribute identifiers.- Returns:
- unique ID of the attribute
-
getDisplayNames
@Deprecated(forRemoval=true, since="4.2") @Nonnull @NonnullElements @Unmodifiable public Map<Locale,String> getDisplayNames()Deprecated, for removal: This API element is subject to removal in a future version.These values should be calculated at point of useGets the localized human readable name of the attribute.- Returns:
- human readable name of the attribute
-
checkedNamesFrom
@Nonnull @Unmodifiable private final Map<Locale,String> checkedNamesFrom(@Nonnull @NonnullElements Map<Locale, String> inputMap) Process input tosetDisplayNames(Map)
and {setDisplayDescriptions(Map)
to strip out null input, null keys, and null values.- Parameters:
inputMap
- the input map.- Returns:
- the unmodifiable, non null-containing output.
-
setDisplayNames
@Deprecated(forRemoval=true, since="4.2") public void setDisplayNames(@Nonnull @NonnullElements Map<Locale, String> newNames) Deprecated, for removal: This API element is subject to removal in a future version.These values should be calculated at point of useReplaces the existing display names for this attribute with the given ones.- Parameters:
newNames
- the new names for this attribute
-
getDisplayDescriptions
@Deprecated(forRemoval=true, since="4.2") @Nonnull @NonnullElements @Unmodifiable public Map<Locale,String> getDisplayDescriptions()Deprecated, for removal: This API element is subject to removal in a future version.These values should be calculated at point of useGets the localized human readable description of attribute.- Returns:
- human readable description of attribute
-
setDisplayDescriptions
@Deprecated(forRemoval=true, since="4.2") public void setDisplayDescriptions(@Nonnull @NonnullElements Map<Locale, String> newDescriptions) Deprecated, for removal: This API element is subject to removal in a future version.These values should be calculated at point of useReplaces the existing display descriptions for this attribute with the given ones.- Parameters:
newDescriptions
- the new descriptions for this attribute
-
getValues
Get the unmodifiable ordered collection of values of the attribute.- Returns:
- values of the attribute
-
setValues
Replaces the existing values for this attribute with the given values.- Parameters:
newValues
- the new values for this attribute
-
contains
Check for a string value amongst this object's value collection.- Parameters:
value
- value to check for- Returns:
- true iff a
StringAttributeValue
exists with the input value - Since:
- 4.3.0
-
compareTo
- Specified by:
compareTo
in interfaceComparable<IdPAttribute>
-
clone
Clones an attribute. The clone will contains defensive copies of this objects display descriptions and names, encoders, and values. The elements of each collection, however, are not themselves cloned.- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
hashCode
public int hashCode() -
equals
-
toString
-