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