public class CloudioAdLibObject extends CloudioObject
Modifier and Type | Class | Description |
---|---|---|
static class |
CloudioAdLibObject.Builder |
Builder to enable convenient custom object creation.
|
Constructor | Description |
---|---|
CloudioAdLibObject() |
Modifier and Type | Method | Description |
---|---|---|
<T> CloudioAttribute<T> |
addAttribute(java.lang.String name,
java.lang.Class<T> type,
CloudioAttributeConstraint constraint) |
Adds a new attribute of the given type (class) and the given name to the object.
|
<T> CloudioAttribute<T> |
addAttribute(java.lang.String name,
java.lang.Class<T> type,
CloudioAttributeConstraint constraint,
T initialValue) |
Adds a new attribute of the given type (class) and the given name to the object.
|
void |
addObject(java.lang.String name,
CloudioObject object) |
Adds the given object to this custom object under the given name.
|
<T extends CloudioObject> |
addObject(java.lang.String name,
java.lang.Class<T> clazz) |
Adds an object of the given class with the given name to the custom object.
|
void |
declareConformance(java.lang.String dataClass) |
Declares conformance of the object for a given data class.
|
CloudioAttribute |
getAttribute(java.lang.String name) |
Returns the attribute with the given name or null if no attribute with the given name is part of the object.
|
CloudioObject |
getObject(java.lang.String name) |
Returns the object with the given name or null if no object with the given name is part of the object.
|
public CloudioObject getObject(java.lang.String name)
name
- Name of the object to return.public <T extends CloudioObject> T addObject(java.lang.String name, java.lang.Class<T> clazz) throws DuplicateNamedItemException, InvalidCloudioObjectException
T
- Type of the object.name
- Name to give to the object after creation.clazz
- The class of the object to create and add.DuplicateNamedItemException
- If there already exists an object with the given name.InvalidCloudioObjectException
- The object class is invalid.public void addObject(java.lang.String name, CloudioObject object) throws DuplicateNamedItemException
name
- Name to give to the object inside the node.object
- The object to add.DuplicateNamedItemException
- If there already exists an object with the given name.public CloudioAttribute getAttribute(java.lang.String name)
name
- Name of the attribute to return.public <T> CloudioAttribute<T> addAttribute(java.lang.String name, java.lang.Class<T> type, CloudioAttributeConstraint constraint) throws DuplicateNamedItemException, InvalidCloudioAttributeException
T
- Attribute's type.name
- Name of the attribute to add.type
- Type of the attribute to add.constraint
- Attribute's constraint.DuplicateNamedItemException
- If there already exists an attribute with the given name.InvalidCloudioAttributeException
- If the type of the attribute is not supported.public <T> CloudioAttribute<T> addAttribute(java.lang.String name, java.lang.Class<T> type, CloudioAttributeConstraint constraint, T initialValue) throws DuplicateNamedItemException, InvalidCloudioAttributeException, CloudioAttributeInitializationException, CloudioAttributeConstraintException
T
- Attribute's type.name
- Name of the attribute to add.type
- Type of the attribute to add.constraint
- Attribute's constraint.initialValue
- Initial value for the attribute.DuplicateNamedItemException
- If there already exists an attribute with the given name.InvalidCloudioAttributeException
- If the type of the attribute is not supported.CloudioAttributeInitializationException
- If the attribute could not be initialized.CloudioAttributeConstraintException
- If the attribute can not be initialized (constraint).public void declareConformance(java.lang.String dataClass)
dataClass
- Data class the object conforms to.