com.unboundid.scim.sdk
Class SCIMObject

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

public class SCIMObject
extends Object

This class represents a Simple Cloud Identity Management (SCIM) object. A SCIM object may be composed of common schema attributes and a collection of attributes from one or more additional schema definitions. This class is not designed to be thread-safe.


Constructor Summary
SCIMObject()
          Create an empty SCIM object that initially has no attributes.
SCIMObject(SCIMObject scimObject)
          Create a new copy of the provided SCIM object.
 
Method Summary
 boolean addAttribute(SCIMAttribute attribute)
          Adds the provided attribute to this object.
 boolean equals(Object o)
          
 SCIMAttribute getAttribute(String schema, String name)
          Retrieves the attribute with the specified name.
 Collection<SCIMAttribute> getAttributes(String schema)
          Retrieves the set of attributes in this object from the specified schema.
 Set<String> getSchemas()
          Retrieves the set of schemas currently contributing attributes to this object.
 boolean hasAttribute(String schema, String name)
          Determines whether this object contains the specified attribute.
 int hashCode()
          
 boolean hasSchema(String schema)
          Determines whether this object contains any attributes in the specified schema.
 boolean matchesFilter(SCIMFilter filter)
          Determine whether this object matches the provided filter parameters.
 boolean removeAttribute(String schema, String name)
          Removes the specified attribute from this object.
 void setAttribute(SCIMAttribute attribute)
          Adds the provided attribute to this object, replacing any existing attribute with the same name.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SCIMObject

public SCIMObject()
Create an empty SCIM object that initially has no attributes. The type of resource is not specified.


SCIMObject

public SCIMObject(SCIMObject scimObject)
Create a new copy of the provided SCIM object.

Parameters:
scimObject - The SCIMObject to copy.
Method Detail

getSchemas

public Set<String> getSchemas()
Retrieves the set of schemas currently contributing attributes to this object.

Returns:
An immutable collection of the URIs of schemas currently contributing attributes to this object.

hasSchema

public boolean hasSchema(String schema)
Determines whether this object contains any attributes in the specified schema.

Parameters:
schema - The URI of the schema for which to make the determination. It must not be null.
Returns:
true if this object contains any attributes in the specified schema, or false if not.

getAttribute

public SCIMAttribute getAttribute(String schema,
                                  String name)
Retrieves the attribute with the specified name.

Parameters:
schema - The URI of the schema containing the attribute to retrieve.
name - The name of the attribute to retrieve. It must not be null.
Returns:
The requested attribute from this object, or null if the specified attribute is not present in this object.

getAttributes

public Collection<SCIMAttribute> getAttributes(String schema)
Retrieves the set of attributes in this object from the specified schema.

Parameters:
schema - The URI of the schema whose attributes are to be retrieved.
Returns:
An immutable collection of the attributes in this object from the specified schema, or the empty collection if there are no such attributes.

hasAttribute

public boolean hasAttribute(String schema,
                            String name)
Determines whether this object contains the specified attribute.

Parameters:
schema - The URI of the schema containing the attribute.
name - The name of the attribute for which to make the determination. It must not be null.
Returns:
true if this object contains the specified attribute, or false if not.

addAttribute

public boolean addAttribute(SCIMAttribute attribute)
Adds the provided attribute to this object. If this object already contains an attribute with the same name from the same schema, then the provided attribute will not be added.

Parameters:
attribute - The attribute to be added. It must not be null.
Returns:
true if the object was updated, or false if the object already contained an attribute with the same name.

setAttribute

public void setAttribute(SCIMAttribute attribute)
Adds the provided attribute to this object, replacing any existing attribute with the same name.

Parameters:
attribute - The attribute to be added. It must not be null.

removeAttribute

public boolean removeAttribute(String schema,
                               String name)
Removes the specified attribute from this object.

Parameters:
schema - The URI of the schema to which the attribute belongs.
name - The name of the attribute to remove. It must not be null.
Returns:
true if the attribute was removed from the object, or false if it was not present.

matchesFilter

public boolean matchesFilter(SCIMFilter filter)
Determine whether this object matches the provided filter parameters.

Parameters:
filter - The filter parameters to compare against the object.
Returns:
true if this object matches the provided filter, and false otherwise.

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2011-2012 UnboundID. All Rights Reserved.