Class Attribute
- java.lang.Object
- 
- com.ibm.oauth.core.api.attributes.Attribute
 
- 
 public class Attribute extends java.lang.ObjectAnAttributeconsists 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 SummaryConstructors Constructor Description Attribute(java.lang.String name, java.lang.String type, java.lang.String value)Construct an attribute based on it's name, type and a single string values.Attribute(java.lang.String name, java.lang.String type, java.lang.String[] values)Construct an attribute based on it's name, type and an array of values.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()Returns the name of the attributejava.lang.StringgetType()Returns the attribute type string.java.lang.StringgetValue()Returns the first string value for the attribute if any.java.util.List<java.lang.String>getValues()The list of string values.java.lang.String[]getValuesArray()The string values as an immutable array.voidsetValues(java.lang.String[] values)Resets the values of the attribute to the list of strings in the passed array.java.lang.StringtoString()String representation of an attribute useful for debug tracing
 
- 
- 
- 
Constructor Detail- 
Attributepublic Attribute(java.lang.String name, java.lang.String type, java.lang.String[] values)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 construct
- type- type of attribute - typically a URN
- values- array of String values
 
 - 
Attributepublic Attribute(java.lang.String name, java.lang.String type, java.lang.String value)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 construct
- type- type of attribute - typically a URN
- value- single String value
 
 
- 
 - 
Method Detail- 
getNamepublic java.lang.String getName() Returns the name of the attribute- Returns:
- name of attribute
 
 - 
getTypepublic java.lang.String getType() Returns the attribute type string. May be null if no type was specified- Returns:
- type string for the attribute
 
 - 
getValuespublic java.util.List<java.lang.String> 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.
 
 - 
getValuesArraypublic java.lang.String[] 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.
 
 - 
getValuepublic java.lang.String getValue() Returns the first string value for the attribute if any. If the list has no values, null is returned.- Returns:
 
 - 
setValuespublic void setValues(java.lang.String[] values) 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
 
 - 
toStringpublic java.lang.String toString() String representation of an attribute useful for debug tracing- Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-