Class 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 Detail

      • SPACE_CONTAINING

        private static final Predicate<String> SPACE_CONTAINING
        Value for testing illegal name.
      • LOG

        @Nonnull
        private static final org.slf4j.Logger LOG
        Logger - static.
      • id

        @Nonnull
        private final String id
        ID of this attribute.
      • displayNames

        @Nonnull
        private Map<Locale,​String> displayNames
        Localized human intelligible attribute names.
      • displayDescriptions

        @Nonnull
        private Map<Locale,​String> displayDescriptions
        Localized human readable descriptions of attribute.
    • Constructor Detail

      • IdPAttribute

        public IdPAttribute​(@Nonnull @NotEmpty @ParameterName(name="attributeId")
                            String attributeId)
        Constructor.
        Parameters:
        attributeId - unique identifier of the attribute
    • Method Detail

      • isDeprecatedId

        public static boolean isDeprecatedId​(@Nonnull @NotEmpty
                                             String id)
        Centralized method to police deprecated Identifiers.
        Parameters:
        id - what to test
        Returns:
        whether the name is currently deprecated.
      • isInvalidId

        public static boolean isInvalidId​(@Nullable
                                          String id)
        Centralized method to police invalid Identifiers.
        Parameters:
        id - what to test
        Returns:
        whether the name is disallowed.
      • getId

        @Nonnull
        @NotEmpty
        public String 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 use
        Gets the localized human readable name of the attribute.
        Returns:
        human readable name of the attribute
      • 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 use
        Replaces 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 use
        Gets 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 use
        Replaces the existing display descriptions for this attribute with the given ones.
        Parameters:
        newDescriptions - the new descriptions for this attribute
      • setValues

        public void setValues​(@Nullable @NullableElements
                              Collection<IdPAttributeValue> newValues)
        Replaces the existing values for this attribute with the given values.
        Parameters:
        newValues - the new values for this attribute
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object