public abstract class SCIMAttributeValue extends Object
Constructor and Description |
---|
SCIMAttributeValue() |
Modifier and Type | Method and Description |
---|---|
static SCIMAttributeValue |
createBinaryValue(byte[] value)
Create a new simple binary attribute value.
|
static SCIMAttributeValue |
createBooleanValue(Boolean value)
Create a new simple Boolean attribute value.
|
static SCIMAttributeValue |
createComplexValue(Collection<SCIMAttribute> attributes)
Create a new complex attribute value from a collection of attributes.
|
static SCIMAttributeValue |
createComplexValue(SCIMAttribute... attributes)
Create a new complex attribute value from the provided attributes.
|
static SCIMAttributeValue |
createDateValue(Date value)
Create a new simple Date attribute value.
|
static SCIMAttributeValue |
createSimpleValue(SimpleValue simpleValue)
Create a new simple attribute value.
|
static SCIMAttributeValue |
createStringValue(String value)
Create a new simple String attribute value.
|
static SCIMAttributeValue |
createValue(AttributeDescriptor.DataType dataType,
String value)
Create a new simple attribute value of the specified data type.
|
SCIMAttribute |
getAttribute(String attributeName)
Retrieves the attribute with the provided name from the complex value,
or
null if there is no such attribute or the attribute value is
simple. |
abstract Map<String,SCIMAttribute> |
getAttributes()
Retrieves the attributes comprising the complex value, keyed by the lower
case name of the attribute, or
null if the attribute value is
simple. |
byte[] |
getBinaryValue()
Retrieves the simple Binary value, or
null if the attribute
value is complex. |
Boolean |
getBooleanValue()
Retrieves the simple Boolean value, or
null if the attribute
value is complex. |
Date |
getDateValue()
Retrieves the simple Date value, or
null if the attribute
value is complex. |
Double |
getDecimalValue()
Retrieves the simple Decimal value, or
null if the attribute
value is complex. |
Long |
getIntegerValue()
Retrieves the simple Long value, or
null if the attribute
value is complex. |
String |
getStringValue()
Retrieves the simple String value, or
null if the attribute
value is complex. |
<T> T |
getSubAttributeValue(String name,
AttributeValueResolver<T> resolver)
Retrieves the value of a sub-attribute.
|
<T> Collection<T> |
getSubAttributeValues(String name,
AttributeValueResolver<T> resolver)
Retrieves the value of a multi-valued sub-attribute value.
|
abstract SimpleValue |
getValue()
Retrieves the simple value, or
null if the attribute value is
complex. |
boolean |
hasAttribute(String attributeName)
Indicates whether a complex value has an attribute with the provided name.
|
abstract boolean |
isComplex()
Determines whether this attribute value is simple or complex.
|
public SCIMAttributeValue()
public static SCIMAttributeValue createValue(AttributeDescriptor.DataType dataType, String value)
dataType
- The data type of the value.value
- The string representation of the value.public static SCIMAttributeValue createStringValue(String value)
value
- The String attribute value.public static SCIMAttributeValue createBooleanValue(Boolean value)
value
- The Boolean attribute value.public static SCIMAttributeValue createDateValue(Date value)
value
- The Date attribute value.public static SCIMAttributeValue createBinaryValue(byte[] value)
value
- The binary attribute value.public static SCIMAttributeValue createSimpleValue(SimpleValue simpleValue)
simpleValue
- The SimpleValue attribute value.public <T> T getSubAttributeValue(String name, AttributeValueResolver<T> resolver)
T
- The type of the resolved instance representing the
value of sub-attribute.name
- The name of the sub-attribute.resolver
- The AttributeValueResolver
that should
be used to resolve the value into an instance.public <T> Collection<T> getSubAttributeValues(String name, AttributeValueResolver<T> resolver)
T
- The type of the resolved instance representing the value of
sub-attribute.name
- The name of the attribute value to retrieve.resolver
- The AttributeValueResolver
the should be used
to resolve the value to an instance.null
if
the specified attribute does not exist.public static SCIMAttributeValue createComplexValue(SCIMAttribute... attributes)
attributes
- The attributes comprising the complex value.public static SCIMAttributeValue createComplexValue(Collection<SCIMAttribute> attributes)
attributes
- The attributes comprising the complex value.public abstract boolean isComplex()
true
if this attribute value is complex, or false
otherwise.public abstract SimpleValue getValue()
null
if the attribute value is
complex.null
if the attribute value is
complex.public String getStringValue()
null
if the attribute
value is complex.null
if the attribute
value is complex.public Boolean getBooleanValue()
null
if the attribute
value is complex.null
if the attribute
value is complex.public Double getDecimalValue()
null
if the attribute
value is complex.null
if the attribute
value is complex.public Long getIntegerValue()
null
if the attribute
value is complex.null
if the attribute
value is complex.public Date getDateValue()
null
if the attribute
value is complex.null
if the attribute
value is complex.public byte[] getBinaryValue()
null
if the attribute
value is complex.null
if the attribute
value is complex.public abstract Map<String,SCIMAttribute> getAttributes()
null
if the attribute value is
simple.public SCIMAttribute getAttribute(String attributeName)
null
if there is no such attribute or the attribute value is
simple.attributeName
- The name of the desired attribute.null
if there
is no such attribute or the attribute value is simple.public boolean hasAttribute(String attributeName)
attributeName
- The attribute name for which to make the
determination.true
if there is an attribute with the provided name,
false
if there is no such attribute or this attribute
value is simple.Copyright © 2011-2015 UnboundID. All Rights Reserved.