Class Attribute

  • All Implemented Interfaces:
    java.io.Serializable

    public class Attribute
    extends java.lang.Object
    implements java.io.Serializable
    This class represents a credential attribute. Credential attribute consists of a name and a value set.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Attribute​(java.lang.String name)
      Create a credential attribute with the specified name.
      Attribute​(java.lang.String name, java.lang.String value)
      Create a credential attribute with the specified name and a value set containing the specified value.
      Attribute​(java.lang.String name, java.util.Set<java.lang.String> values)
      Create a credential attribute with the specified name and the specified value set.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addValue​(java.lang.String value)
      Add the specified value to the value set.
      boolean equals​(java.lang.Object object)
      Check whether the specified object is equal to this credential attribute.
      java.lang.String getName()
      Get the name.
      java.util.Set<java.lang.String> getValues()
      Get the value set.
      int hashCode()
      Get the hash code of this credential attribute.
      boolean hasValue​(java.lang.String value)
      Check whether the specified value is contained in the value set.
      void removeValue​(java.lang.String value)
      Remove the specified value from the value set of this credential attribute.
      void setValues​(java.util.Set<java.lang.String> values)
      Set the value set.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Attribute

        public Attribute​(java.lang.String name)
        Create a credential attribute with the specified name. The value set is empty.
        Parameters:
        name - The name.
      • Attribute

        public Attribute​(java.lang.String name,
                         java.lang.String value)
        Create a credential attribute with the specified name and a value set containing the specified value.
        Parameters:
        name - The name.
        value - The value.
      • Attribute

        public Attribute​(java.lang.String name,
                         java.util.Set<java.lang.String> values)
        Create a credential attribute with the specified name and the specified value set.
        Parameters:
        name - The name.
        values - The value set.
    • Method Detail

      • getName

        public java.lang.String getName()
        Get the name.
        Returns:
        The name.
      • getValues

        public java.util.Set<java.lang.String> getValues()
        Get the value set. If the returned value set is modified, call the method setValues(Set) to persist the modifications.
        Returns:
        The value set.
      • setValues

        public void setValues​(java.util.Set<java.lang.String> values)
        Set the value set.
        Parameters:
        values - The value set.
      • addValue

        public void addValue​(java.lang.String value)
        Add the specified value to the value set. If the value set already contains the specified value, the specified value is not added.
        Parameters:
        value - The value.
      • hasValue

        public boolean hasValue​(java.lang.String value)
        Check whether the specified value is contained in the value set.
        Parameters:
        value - The value.
        Returns:
        Whether the specified value is contained in the value set.
      • removeValue

        public void removeValue​(java.lang.String value)
        Remove the specified value from the value set of this credential attribute.
        Parameters:
        value - The value.
      • equals

        public boolean equals​(java.lang.Object object)
        Check whether the specified object is equal to this credential attribute. An object is equal to this credential attribute if and only if (1) the object is an instance of Attribute, and (2) the name of the object is equal to the name of this credential attribute.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        object - The object.
        Returns:
        Whether the specified object is equal to this credential attribute.
      • hashCode

        public int hashCode()
        Get the hash code of this credential attribute.
        Overrides:
        hashCode in class java.lang.Object