Class UserAttribute
java.lang.Object
se.swedenconnect.spring.saml.idp.attributes.UserAttribute
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
RequestedAttribute
A representation of a user (identity) attribute.
- Author:
- Martin Lindström
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Class used to store attribute value types that we don't know how to parse. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The default name format for SAML attributes. -
Constructor Summary
ConstructorDescriptionUserAttribute
(String id) Constructor.UserAttribute
(String id, String friendlyName) Constructor.UserAttribute
(String id, String friendlyName, Serializable value) Constructor.UserAttribute
(String id, String friendlyName, List<? extends Serializable> values) Constructor.UserAttribute
(org.opensaml.saml.saml2.core.Attribute attribute) Constructs anUserAttribute
given an OpenSAMLAttribute
. -
Method Summary
Modifier and TypeMethodDescriptionGets the attribute friendly name.getId()
Gets the attribute ID (name).Gets the name format URI for the attribute.Gets the attribute value(s) in string format.List
<? extends Serializable> Gets the attribute value(s).void
setFriendlyName
(String friendlyName) Assigns the friendly name.void
setNameFormat
(String nameFormat) Assigns the attribute name format.void
setValue
(Serializable value) Assigns the attribute value.void
setValues
(List<? extends Serializable> values) Assigns the attribute values.org.opensaml.saml.saml2.core.Attribute
Converts this object into an OpenSAMLAttribute
object.toString()
-
Field Details
-
DEFAULT_NAME_FORMAT
The default name format for SAML attributes.- See Also:
-
-
Constructor Details
-
UserAttribute
Constructor.- Parameters:
id
- the attribute ID (name)
-
UserAttribute
Constructor.- Parameters:
id
- the attribute ID (name)friendlyName
- the attribute friendly name
-
UserAttribute
Constructor.- Parameters:
id
- the attribute ID (name)friendlyName
- the attribute friendly namevalue
- the attribute value
-
UserAttribute
Constructor.- Parameters:
id
- the attribute ID (name)friendlyName
- the attribute friendly namevalues
- the attribute values
-
UserAttribute
public UserAttribute(org.opensaml.saml.saml2.core.Attribute attribute) Constructs anUserAttribute
given an OpenSAMLAttribute
.- Parameters:
attribute
- an OpenSAMLAttribute
-
-
Method Details
-
getId
Gets the attribute ID (name).- Returns:
- the attribute ID (name)
-
getFriendlyName
Gets the attribute friendly name.- Returns:
- the attribute friendly name (or
null
if none has been assigned)
-
setFriendlyName
Assigns the friendly name.- Parameters:
friendlyName
- the friendly name
-
getNameFormat
Gets the name format URI for the attribute.- Returns:
- the name format
-
setNameFormat
Assigns the attribute name format.- Parameters:
nameFormat
- the name format
-
getValues
Gets the attribute value(s).- Returns:
- the attribute value(s)
-
getStringValues
Gets the attribute value(s) in string format.- Returns:
- the attribute value(s) in string format
-
setValue
Assigns the attribute value.- Parameters:
value
- the value- See Also:
-
setValues
Assigns the attribute values.- Parameters:
values
- the values- See Also:
-
toOpenSamlAttribute
public org.opensaml.saml.saml2.core.Attribute toOpenSamlAttribute()Converts this object into an OpenSAMLAttribute
object.- Returns:
- an OpenSAML
Attribute
-
toString
-
valuesToString
-