com.unboundid.scim.sdk
Class SCIMAttributeValue

java.lang.Object
  extended by com.unboundid.scim.sdk.SCIMAttributeValue

public final class SCIMAttributeValue
extends Object

This class represents a Simple Cloud Identity Management (SCIM) attribute value. Values are categorized as either Simple or Complex.


Constructor Summary
SCIMAttributeValue(SimpleValue value)
          Create a new instance of a SCIM attribute value.
 
Method Summary
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 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.
 boolean equals(Object o)
          
 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.
 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.
 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.
 int hashCode()
          
 boolean isComplex()
          Determines whether this attribute value is simple or complex.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SCIMAttributeValue

public SCIMAttributeValue(SimpleValue value)
Create a new instance of a SCIM attribute value.

Parameters:
value - The simple value.
Method Detail

createValue

public static SCIMAttributeValue createValue(AttributeDescriptor.DataType dataType,
                                             String value)
Create a new simple attribute value of the specified data type.

Parameters:
dataType - The data type of the value.
value - The string representation of the value.
Returns:
The new simple attribute value.

createStringValue

public static SCIMAttributeValue createStringValue(String value)
Create a new simple String attribute value.

Parameters:
value - The String attribute value.
Returns:
The new simple attribute.

createBooleanValue

public static SCIMAttributeValue createBooleanValue(Boolean value)
Create a new simple Boolean attribute value.

Parameters:
value - The Boolean attribute value.
Returns:
The new simple attribute.

createDateValue

public static SCIMAttributeValue createDateValue(Date value)
Create a new simple Date attribute value.

Parameters:
value - The Date attribute value.
Returns:
The new simple attribute.

createBinaryValue

public static SCIMAttributeValue createBinaryValue(byte[] value)
Create a new simple binary attribute value.

Parameters:
value - The binary attribute value.
Returns:
The new simple attribute.

getSubAttributeValue

public <T> T getSubAttributeValue(String name,
                                  AttributeValueResolver<T> resolver)
Retrieves the value of a sub-attribute.

Type Parameters:
T - The type of the resolved instance representing the value of sub-attribute.
Parameters:
name - The name of the sub-attribute.
resolver - The AttributeValueResolver that should be used to resolve the value into an instance.
Returns:
The resolved instance representing the value of sub-attribute.

getSubAttributeValues

public <T> Collection<T> getSubAttributeValues(String name,
                                               AttributeValueResolver<T> resolver)
Retrieves the value of a multi-valued sub-attribute value.

Type Parameters:
T - The type of the resolved instance representing the value of sub-attribute.
Parameters:
name - The name of the attribute value to retrieve.
resolver - The AttributeValueResolver the should be used to resolve the value to an instance.
Returns:
The collection of resolved value instances or null if the specified attribute does not exist.

toString

public String toString()

Overrides:
toString in class Object

createComplexValue

public static SCIMAttributeValue createComplexValue(SCIMAttribute... attributes)
Create a new complex attribute value from the provided attributes.

Parameters:
attributes - The attributes comprising the complex value.
Returns:
The new complex attribute.

createComplexValue

public static SCIMAttributeValue createComplexValue(Collection<SCIMAttribute> attributes)
Create a new complex attribute value from a collection of attributes.

Parameters:
attributes - The attributes comprising the complex value.
Returns:
The new complex attribute value.

isComplex

public boolean isComplex()
Determines whether this attribute value is simple or complex.

Returns:
true if this attribute value is complex, or false otherwise.

getValue

public SimpleValue getValue()
Retrieves the simple value, or null if the attribute value is complex.

Returns:
The simple value, or null if the attribute value is complex.

getStringValue

public String getStringValue()
Retrieves the simple String value, or null if the attribute value is complex.

Returns:
The simple String value, or null if the attribute value is complex.

getBooleanValue

public Boolean getBooleanValue()
Retrieves the simple Boolean value, or null if the attribute value is complex.

Returns:
The simple Boolean value, or null if the attribute value is complex.

getDecimalValue

public Double getDecimalValue()
Retrieves the simple Decimal value, or null if the attribute value is complex.

Returns:
The simple Decimal value, or null if the attribute value is complex.

getIntegerValue

public Long getIntegerValue()
Retrieves the simple Long value, or null if the attribute value is complex.

Returns:
The simple Long value, or null if the attribute value is complex.

getDateValue

public Date getDateValue()
Retrieves the simple Date value, or null if the attribute value is complex.

Returns:
The simple Date value, or null if the attribute value is complex.

getBinaryValue

public byte[] getBinaryValue()
Retrieves the simple Binary value, or null if the attribute value is complex.

Returns:
The simple Binary value, or null if the attribute value is complex.

getAttributes

public 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.

Returns:
The attributes comprising the complex value.

getAttribute

public 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.

Parameters:
attributeName - The name of the desired attribute.
Returns:
The attribute with the provided name, or null if there is no such attribute or the attribute value is simple.

hasAttribute

public boolean hasAttribute(String attributeName)
Indicates whether a complex value has an attribute with the provided name.

Parameters:
attributeName - The attribute name for which to make the determination.
Returns:
true if there is an attribute with the provided name, false if there is no such attribute or this attribute value is simple.

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object


Copyright © 2011-2012 UnboundID. All Rights Reserved.