Package net.shibboleth.idp.attribute
Class IdPAttributeSupport
java.lang.Object
net.shibboleth.idp.attribute.IdPAttributeSupport
Class for general support functions for managing
IdPAttribute objects.- Since:
- 5.2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<String,IdPAttribute> toMapMergeDuplicates(Collection<IdPAttribute> attributes) static Map<String,IdPAttribute> toMapNoDuplicates(Collection<IdPAttribute> attributes) static Map<String,IdPAttribute> withMapMergeDuplicates(Map<String, IdPAttribute> existingAttributes, Collection<IdPAttribute> newAttributes) static Map<String,IdPAttribute> withMapMergeDuplicates(Map<String, IdPAttribute> existingAttributes, Map<String, IdPAttribute> newAttributes)
-
Constructor Details
-
IdPAttributeSupport
private IdPAttributeSupport()Private constructor.
-
-
Method Details
-
toMapNoDuplicates
@Nonnull @Live public static Map<String,IdPAttribute> toMapNoDuplicates(@Nullable Collection<IdPAttribute> attributes) Convert a collection ofIdPAttributeobjects into a mutableMapkeyed byIdPAttribute.getId().If an attribute with a duplicate ID is found, then we issue a warning and an arbitrary one is chosen.
- Parameters:
attributes- collection of attributes- Returns:
- the input attributes in a map keyed by
IdPAttribute.getId()
-
toMapMergeDuplicates
@Nonnull @Live public static Map<String,IdPAttribute> toMapMergeDuplicates(@Nullable Collection<IdPAttribute> attributes) Convert a collection ofIdPAttributeobjects into a mutableMapkeyed byIdPAttribute.getId().If an attribute with a duplicate ID is found, then we merge the values into a single attribute.
- Parameters:
attributes- collection of attributes- Returns:
- the input attributes in a map keyed by
IdPAttribute.getId()
-
withMapMergeDuplicates
@Nonnull @Live public static Map<String,IdPAttribute> withMapMergeDuplicates(@Nonnull @Live Map<String, IdPAttribute> existingAttributes, @Nonnull Map<String, IdPAttribute> newAttributes) Add a collection ofIdPAttributeobjects into a mutable inputMapkeyed byIdPAttribute.getId().If an attribute with a duplicate ID is found, then we merge the values into a single attribute.
- Parameters:
existingAttributes- an existing mutable map to merge intonewAttributes- collection to merge into map- Returns:
- the input map after merging is done
-
withMapMergeDuplicates
@Nonnull @Live public static Map<String,IdPAttribute> withMapMergeDuplicates(@Nonnull @Live Map<String, IdPAttribute> existingAttributes, @Nullable Collection<IdPAttribute> newAttributes) Add a collection ofIdPAttributeobjects into a mutable inputMapkeyed byIdPAttribute.getId().If an attribute with a duplicate ID is found, then we merge the values into a single attribute.
- Parameters:
existingAttributes- an existing mutable map to merge intonewAttributes- collection to merge into map- Returns:
- the input map after merging is done
-