public class Attribute
extends java.lang.Object
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 and 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.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName()
Returns the name of the attribute
|
java.lang.String |
getType()
Returns the attribute type string.
|
java.lang.String |
getValue()
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.
|
void |
setValues(java.lang.String[] values)
Resets the values of the attribute to the list of strings in the passed
array.
|
java.lang.String |
toString()
String representation of an attribute useful for debug tracing
|
public Attribute(java.lang.String name, java.lang.String type, java.lang.String[] values)
name
- name of the attribute to constructtype
- type of attribute - typically a URNvalues
- array of String valuespublic Attribute(java.lang.String name, java.lang.String type, java.lang.String value)
name
- name of the attribute to constructtype
- type of attribute - typically a URNvalue
- single String valuepublic java.lang.String getName()
public java.lang.String getType()
public java.util.List<java.lang.String> getValues()
public java.lang.String[] getValuesArray()
public java.lang.String getValue()
public void setValues(java.lang.String[] values)
values
- new list of values for the attributepublic java.lang.String toString()
toString
in class java.lang.Object