Class AttributeImpl

java.lang.Object
org.glassfish.security.services.impl.common.AttributeImpl
All Implemented Interfaces:
Attribute

public class AttributeImpl extends Object implements Attribute
  • Constructor Details

    • AttributeImpl

      protected AttributeImpl()
    • AttributeImpl

      public AttributeImpl(String name)
    • AttributeImpl

      public AttributeImpl(String name, String value)
    • AttributeImpl

      public AttributeImpl(String name, Set<String> values)
    • AttributeImpl

      public AttributeImpl(String name, String[] values)
  • Method Details

    • getValueCount

      public int getValueCount()
      Description copied from interface: Attribute
      Get a count of the number of values this attribute has (0-n).
      Specified by:
      getValueCount in interface Attribute
      Returns:
      The value count.
    • getName

      public String getName()
      Description copied from interface: Attribute
      Get the name of this attribute.
      Specified by:
      getName in interface Attribute
      Returns:
      The name.
    • getValue

      public String getValue()
      Description copied from interface: Attribute
      Get the first value from the Set of attribute values, or null if the attribute has no values. This is a shorthand method that should be useful for single-valued attributes, but note that there are no guarantees about which value is returned in the case that there are multiple values. The value returned will be whichever value the underlying Set implementation returns first.
      Specified by:
      getValue in interface Attribute
      Returns:
      The attribute value.
    • getValues

      public Set<String> getValues()
      Description copied from interface: Attribute
      Get the Set of values for this attribute. The Set returned is a copy of the original; changes to this Set will not affect the original.
      Specified by:
      getValues in interface Attribute
      Returns:
      The attribute values Set.
    • getValuesAsArray

      public String[] getValuesAsArray()
      Description copied from interface: Attribute
      Return the attributes values as a String array. Note that this array can be zero-length in the case that there are no values.
      Specified by:
      getValuesAsArray in interface Attribute
      Returns:
      The attribute values array.
    • addValue

      public void addValue(String value)
      Specified by:
      addValue in interface Attribute
    • addValues

      public void addValues(Set<String> values)
      Specified by:
      addValues in interface Attribute
    • addValues

      public void addValues(String[] values)
      Specified by:
      addValues in interface Attribute
    • removeValue

      public void removeValue(String value)
      Specified by:
      removeValue in interface Attribute
    • removeValues

      public void removeValues(Set<String> values)
      Specified by:
      removeValues in interface Attribute
    • removeValues

      public void removeValues(String[] values)
      Specified by:
      removeValues in interface Attribute
    • clear

      public void clear()
      Specified by:
      clear in interface Attribute