Class AttributeImpl
- java.lang.Object
-
- org.glassfish.security.services.impl.common.AttributeImpl
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AttributeImpl()
AttributeImpl(String name)
AttributeImpl(String name, String value)
AttributeImpl(String name, String[] values)
AttributeImpl(String name, Set<String> values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(String value)
void
addValues(String[] values)
void
addValues(Set<String> values)
void
clear()
String
getName()
Get the name of this attribute.String
getValue()
Get the first value from the Set of attribute values, or null if the attribute has no values.int
getValueCount()
Get a count of the number of values this attribute has (0-n).Set<String>
getValues()
Get the Set of values for this attribute.String[]
getValuesAsArray()
Return the attributes values as a String array.void
removeValue(String value)
void
removeValues(String[] values)
void
removeValues(Set<String> values)
-
-
-
Constructor Detail
-
AttributeImpl
protected AttributeImpl()
-
AttributeImpl
public AttributeImpl(String name)
-
-
Method Detail
-
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 interfaceAttribute
- Returns:
- The value count.
-
getName
public String getName()
Description copied from interface:Attribute
Get the name of this attribute.
-
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.
-
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.
-
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 interfaceAttribute
- Returns:
- The attribute values array.
-
removeValue
public void removeValue(String value)
- Specified by:
removeValue
in interfaceAttribute
-
removeValues
public void removeValues(Set<String> values)
- Specified by:
removeValues
in interfaceAttribute
-
removeValues
public void removeValues(String[] values)
- Specified by:
removeValues
in interfaceAttribute
-
-