Class AttributeList
- java.lang.Object
- 
- com.ibm.oauth.core.api.attributes.AttributeList
 
- 
 public class AttributeList extends java.lang.ObjectAn ordered list of attributes used throughout the component to communicate full state and information in OAuth request and response. An attribute will be uniquely identified in the list by its name and type. Therefore an attribute list cannot have two attributes with the same name and type.
- 
- 
Constructor SummaryConstructors Constructor Description AttributeList()One and only constructor which builds a new empty list of attributes.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Attribute>getAllAttributes()Gets all attributes in the attribute list.AttributegetAttributeByNameAndType(java.lang.String name, java.lang.String type)Returns a reference to an attribute within the attribute list identified by its name and type.Attribute[]getAttributesByType(java.lang.String type)Returns an array of attributes from the list that match a given type.java.lang.StringgetAttributeValueByName(java.lang.String name)Returns the first string value of an attribute from the attribute list identified by its name only.java.lang.StringgetAttributeValueByNameAndType(java.lang.String name, java.lang.String type)Returns the first string value of an attribute from the attribute list identified by its name and type.java.lang.String[]getAttributeValuesByName(java.lang.String name)Returns the list of string values (as a string array) of an attribute from the attribute list identified by its name only.java.lang.String[]getAttributeValuesByNameAndType(java.lang.String name, java.lang.String type)Returns the list of string values (as a string array) of an attribute from the attribute list identified by its name and type.voidsetAttribute(java.lang.String name, java.lang.String type, java.lang.String[] values)Set the values of an attribute in the attribute list identified by name and type.java.lang.StringtoString()String representation of the attribute list useful for debug tracing.
 
- 
- 
- 
Method Detail- 
getAttributeValueByNameAndTypepublic java.lang.String getAttributeValueByNameAndType(java.lang.String name, java.lang.String type)Returns the first string value of an attribute from the attribute list identified by its name and type. Name and type checking are done as string comparisons. If the type of an attribute is not defined (null) then it will ONLY match if the requested type is also null. Similarly if the requested type is null, only attributes with a null (undefined) type will be matched.- Parameters:
- name- name of attribute
- type- type of attribute
- Returns:
- first string value of a matching attribute from the attribute list or null if no matching attribute
 
 - 
getAttributeValueByNamepublic java.lang.String getAttributeValueByName(java.lang.String name) Returns the first string value of an attribute from the attribute list identified by its name only. If more than one attribute in the attribute list has the same name (and different types), the first value of the first matching attribute will be returned.- Parameters:
- name- name of attribute
- Returns:
- first string value of a matching attribute from the attribute list or null if no matching attribute
 
 - 
getAttributeValuesByNameAndTypepublic java.lang.String[] getAttributeValuesByNameAndType(java.lang.String name, java.lang.String type)Returns the list of string values (as a string array) of an attribute from the attribute list identified by its name and type. Name and type checking are done as string comparisons. If the type of an attribute is not defined (null) then it will ONLY match if the requested type is also null. Similarly if the requested type is null, only attributes with a null (undefined) type will be matched.- Parameters:
- name- name of attribute
- type- type of attribute
- Returns:
- string array of values of a matching attribute from the attribute list or null if no matching attribute
 
 - 
getAttributeValuesByNamepublic java.lang.String[] getAttributeValuesByName(java.lang.String name) Returns the list of string values (as a string array) of an attribute from the attribute list identified by its name only. If more than one attribute in the attribute list has the same name (and different types), the values of the first matching attribute will be returned.- Parameters:
- name- name of attribute
- Returns:
- string array of values of a matching attribute from the attribute list or null if no matching attribute
 
 - 
setAttributepublic void setAttribute(java.lang.String name, java.lang.String type, java.lang.String[] values)Set the values of an attribute in the attribute list identified by name and type. If an existing attribute with that name and type already appears in the attribute list its values will be replaced otherwise a new attribute will be appended to the list.- Parameters:
- name- - name of attribute to update/add
- type- - type of attribute to update/add
- values- - array of string values of attribute to update/add
 
 - 
getAttributeByNameAndTypepublic Attribute getAttributeByNameAndType(java.lang.String name, java.lang.String type) Returns a reference to an attribute within the attribute list identified by its name and type. If the attribute is modified, it will be modified in the list. If no attribute with that name and type exists in the list, returns null.- Parameters:
- name- - name of attribute
- type- - type of attribute
- Returns:
- reference to the attribute in the list, or null if an attribute with that name and type cannot be located.
 
 - 
getAttributesByTypepublic Attribute[] getAttributesByType(java.lang.String type) Returns an array of attributes from the list that match a given type. Each attribute is a reference so any modifications to attributes returned in the array will be reflected in the attribute list.- Parameters:
- type- type of attribute to match
- Returns:
- an array of attributes that match the given type, or null if there are no attributes with that type in the list.
 
 - 
getAllAttributespublic java.util.List<Attribute> getAllAttributes() Gets all attributes in the attribute list.- Returns:
- a list of attributes
 
 - 
toStringpublic java.lang.String toString() String representation of the attribute list useful for debug tracing.- Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-