Class ComplexAttribute<T extends ComplexAttributeValue<T>>
Object
se.curity.identityserver.sdk.attribute.Attribute
se.curity.identityserver.sdk.attribute.scim.v2.ComplexAttribute<T>
- Type Parameters:
T- Type of Attribute
- All Implemented Interfaces:
Iterable<AttributeValue>,AttributeOrAttributeValue<Attribute>
Attribute whose value is a collection of objects, used to represent the Complex Attribute of SCIM.
The json representation of the attribute value is an array of objects
Example phoneNumbers:
"phoneNumbers": [
{
"type": "work",
"value: "+46771793336",
"primary": true
},
{
"type": "home",
"value": "+4681234321"
}
]
-
Field Summary
Fields inherited from class se.curity.identityserver.sdk.attribute.Attribute
NO_AUTHORITY -
Method Summary
Modifier and TypeMethodDescriptionAdd an attribute to the collection.static <V extends ComplexAttributeValue<V>>
ComplexAttribute<V>complexAttributeOf(String name, List<V> values) get(int index) Get an object based on the index.Returns the attribute's value.Get an attribute based on the type parameter of the attribute.getByValue(String value) Get an attribute based on the value of the attribute.getItems()Get the attribute marked as primary.Get the attribute marked as primary, or the first in the list if not found.booleanisEmpty()Check if the collection is empty.static <V extends ComplexAttributeValue<V>>
ComplexAttribute<V>of(AttributeName attributeName, ListAttributeValue attributeValues, String authority, Function<MapAttributeValue, V> factory) Remove an attribute from the list.intsize()Get the size of the collection.toList()Move the attributes to a list.withAuthority(String authority) withName(AttributeName name) Methods inherited from class se.curity.identityserver.sdk.attribute.Attribute
equals, getAuthority, getName, getOptionalValueOfType, getValue, getValueOfType, getValuesOfType, getValueWithMetadata, hashCode, hasValueOfType, isMultiValued, iterator, map, of, of, of, of, of, of, of, of, of, of, of, of, ofFlag, ofFlag, stream, toString, withValue, withValueMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
complexAttributeOf
public static <V extends ComplexAttributeValue<V>> ComplexAttribute<V> complexAttributeOf(String name, List<V> values) -
of
public static <V extends ComplexAttributeValue<V>> ComplexAttribute<V> of(AttributeName attributeName, ListAttributeValue attributeValues, String authority, Function<MapAttributeValue, V> factory) -
getItems
-
getPrimary
Get the attribute marked as primary.- Returns:
- the primary attribute
-
getAttributeValue
Description copied from class:AttributeReturns the attribute's value.- Overrides:
getAttributeValuein classAttribute- Returns:
- the value of this attribute.
-
size
public int size()Get the size of the collection.- Returns:
- int size
-
toList
Move the attributes to a list.- Returns:
- list of T
-
get
Get an object based on the index.- Parameters:
index- the index- Returns:
- the object, or null if not found
-
getByType
Get an attribute based on the type parameter of the attribute.- Parameters:
type- the type to lookup- Returns:
- The first found attribute with the given type, or null if not found
- See Also:
-
remove
Remove an attribute from the list.- Parameters:
attribute- to remove. If the attribute is not found, the collection will be copied unchanged.- Returns:
- a copy of the collection, with the attribute removed if found.
-
add
Add an attribute to the collection.- Parameters:
attribute- to add- Returns:
- copy of the collection with the attribute added
-
getByValue
Get an attribute based on the value of the attribute.- Parameters:
value- the value to look for.- Returns:
- The attribute that has the matching value, or null if not found.
-
getPrimaryOrFirst
Get the attribute marked as primary, or the first in the list if not found.- Returns:
- The primary if found, otherwise the first. Null if the list is empty.
-
isEmpty
public boolean isEmpty()Check if the collection is empty.- Returns:
- true if the size is 0
-
withName
-
withName
-
withAuthority
- Overrides:
withAuthorityin classAttribute
-