Constructor and Description |
---|
AttributeFactory() |
Modifier and Type | Method and Description |
---|---|
Attribute |
createAttribute(AttributeDescriptor attributeDescriptor,
String value)
Attempts to create an
Attribute according to the provided AttributeDescriptor
whose value is represented by the given string . |
Serializable |
parseAttributeValue(AttributeDescriptor attributeDescriptor,
String value)
Attempts to parse a value for an
Attribute according to the provided AttributeDescriptor whose value is represented by the given string . |
public Attribute createAttribute(AttributeDescriptor attributeDescriptor, String value)
Attribute
according to the provided AttributeDescriptor
whose value is represented by the given string . Throws an exception if could not be parsed.attributeDescriptor
- The descriptor used to create the attribute.value
- The non-empty string to use to create an attribute value. Multi-valued entities
should be separated by commas.Attribute
conforming to the given AttributeDescriptor
with a value
of that was parsed and processed to Serializable
.IllegalArgumentException
- If the given value could not be parsed or if the inputs were
null or empty.@Nullable public Serializable parseAttributeValue(AttributeDescriptor attributeDescriptor, String value)
Attribute
according to the provided AttributeDescriptor
whose value is represented by the given string . Returns
null
if could not be parsed.
The input must be effectively Serializable
.
attributeDescriptor
- The descriptor to use to parse the value.value
- The string containing the value to be parsed.This work is licensed under a Creative Commons Attribution 4.0 International License.