Class Attribute
java.lang.Object
com.ibm.oauth.core.api.attributes.Attribute
An
Attribute
consists of an attribute by name, type and list
of value(s). An attribute should be uniquely identified by its name and type.
The name is considered as required.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
Returns the name of the attributegetType()
Returns the attribute type string.getValue()
Returns the first string value for the attribute if any.The list of string values.String[]
The string values as an immutable array.void
Resets the values of the attribute to the list of strings in the passed array.toString()
String representation of an attribute useful for debug tracing
-
Constructor Details
-
Attribute
Construct an attribute based on it's name, type and an array of values. Name should be non-null, type is optional and can be null. The values may be empty/null.- Parameters:
name
- name of the attribute to constructtype
- type of attribute - typically a URNvalues
- array of String values
-
Attribute
Construct an attribute based on it's name, type and a single string values. Name should be non-null, type is optional and can be null. The values may be empty/null.- Parameters:
name
- name of the attribute to constructtype
- type of attribute - typically a URNvalue
- single String value
-
-
Method Details
-
getName
Returns the name of the attribute- Returns:
- name of attribute
-
getType
Returns the attribute type string. May be null if no type was specified- Returns:
- type string for the attribute
-
getValues
The list of string values. This List is returned by reference so any modifications to the list also modify the attribute.- Returns:
- reference to list of string values of the attribute. If the attribute has no values, an empty list is returned.
-
getValuesArray
The string values as an immutable array.- Returns:
- array of string values of the attribute. If the attribute has no values, an empty array is returned.
-
getValue
Returns the first string value for the attribute if any. If the list has no values, null is returned.- Returns:
-
setValues
Resets the values of the attribute to the list of strings in the passed array. All existing values are removed.- Parameters:
values
- new list of values for the attribute
-
toString
String representation of an attribute useful for debug tracing
-