com.cumulocity.model
Class ManagedObject<T extends ID>

java.lang.Object
  extended by org.svenson.AbstractDynamicProperties
      extended by com.cumulocity.model.JSONBase
          extended by com.cumulocity.model.Document<T>
              extended by com.cumulocity.model.FragmentDocument<T>
                  extended by com.cumulocity.model.ManagedObject<T>
All Implemented Interfaces:
OwnerSource, org.svenson.DynamicProperties

public class ManagedObject<T extends ID>
extends FragmentDocument<T>
implements OwnerSource

Represents a Managed Object. According to inventory model specification, it extends Document, thus inheriting _id, and adds the generic properties of Managed Objects. _id, from Document is used to uniquely identify a Managed Object.


Constructor Summary
ManagedObject()
           
 
Method Summary
 boolean addAllChildAssets(Collection<T> c)
          Adds a collection of ManagedObjectId as child assets
 boolean addAllChildDevices(Collection<T> c)
          Adds a collection of ManagedObjectId as child devices
 boolean addChildAsset(T e)
          Adds a ManagedObjectId as a child asset
 boolean addChildDevice(T e)
          Adds a ManagedObjectId as a child device
 boolean equals(Object obj)
          Autogenerated by Eclipse
static ManagedObject fromJSON(String json)
          Unmarshall the JSON representation to ManagedObject type.
 Set<T> getChildAssets()
           
 Set<T> getChildDevices()
           
 Date getLastUpdated()
           
 String getName()
           
 String getOwner()
           
 String getType()
           
 int hashCode()
          Autogenerated by Eclipse
 boolean removeAllChildAssets(Collection<T> c)
          Removes a collection of ManagedObjectId from the child assets set
 boolean removeAllChildDevices(Collection<T> c)
          Removes a collection of ManagedObjectId from the child devices set
 boolean removeChildAsset(T o)
          Removes a ManagedObjectId from the child assets set
 boolean removeChildDevice(T o)
          Removes a ManagedObjectId from the child devices set
 void setChildAssets(Collection<T> assets)
          Replaces the underlying assets set with a new synchronized set containing the elements passed in the parameter.
 void setChildAssets(Set<T> assets)
          Replaces the underlying assets set with a new synchronized set containing the elements passed in the parameter.
 void setChildDevices(Collection<T> devices)
          Replaces the underlying devices set with a new synchronized set containing the elements passed in the parameter.
 void setChildDevices(Set<T> devices)
          Replaces the underlying devices set with a new synchronized set containing the elements passed in the parameter.
 void setLastUpdated(Date lastUpdated)
           
 void setName(String name)
           
 void setOwner(String owner)
           
 void setType(String type)
           
 
Methods inherited from class com.cumulocity.model.FragmentDocument
addFragment, addFragments, getFragment, getFragments, removeFragment, setFragments, updateFragment
 
Methods inherited from class com.cumulocity.model.Document
get, get, getFragment, getId, getInternalId, getRevision, set, set, set, setId, setInternalId, setRevision, toString
 
Methods inherited from class com.cumulocity.model.JSONBase
fromJSON, getJSONGenerator, getJSONParser, toJSON
 
Methods inherited from class org.svenson.AbstractDynamicProperties
getProperty, propertyNames, setProperty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManagedObject

public ManagedObject()
Method Detail

getType

@JSONProperty(value="type",
              ignoreIfNull=true)
public String getType()

setType

public void setType(String type)

getName

@JSONProperty(value="name",
              ignoreIfNull=true)
public String getName()

setName

public void setName(String name)

getLastUpdated

@JSONProperty(value="lastUpdated",
              ignoreIfNull=true)
@JSONConverter(type=DateConverter.class)
public Date getLastUpdated()

setLastUpdated

public void setLastUpdated(Date lastUpdated)

getOwner

@JSONProperty(value="owner",
              ignoreIfNull=true)
public String getOwner()
Specified by:
getOwner in interface OwnerSource

setOwner

public void setOwner(String owner)

getChildAssets

@JSONProperty(ignoreIfNull=true)
@JSONConverter(type=IDListTypeConverter.class)
public Set<T> getChildAssets()
Returns:
the childAssets

setChildAssets

public void setChildAssets(Collection<T> assets)
Replaces the underlying assets set with a new synchronized set containing the elements passed in the parameter. Keeps the underlying set synchronized to ensure thread safety and avoid race conditions. A setter method for a Set with a Collection as the parameter is the most useful setter for all third parties, but unfortunately it can not used by SVENSON, and that's the reason there is a specific setter using a Set as the parameter.

Parameters:
assets -

setChildAssets

public void setChildAssets(Set<T> assets)
Replaces the underlying assets set with a new synchronized set containing the elements passed in the parameter. Keeps the underlying set synchronized to ensure thread safety and avoid race conditions. Do not remove this method, it is required by SVENSON!

Parameters:
assets -
See Also:
setChildAssets(final Collection assets)

addChildAsset

public boolean addChildAsset(T e)
Adds a ManagedObjectId as a child asset

Returns:
true if the underlying set was modified

addAllChildAssets

public boolean addAllChildAssets(Collection<T> c)
Adds a collection of ManagedObjectId as child assets

Returns:
true if the underlying set was modified

removeChildAsset

public boolean removeChildAsset(T o)
Removes a ManagedObjectId from the child assets set

Parameters:
o - the ManagedObjectId to remove
Returns:
true if the underlying set was modified
See Also:
Set.remove(java.lang.Object)

removeAllChildAssets

public boolean removeAllChildAssets(Collection<T> c)
Removes a collection of ManagedObjectId from the child assets set

Parameters:
c - the collection of ManagedObjectId to remove
Returns:
true if the underlying set was modified
See Also:
Set.removeAll(java.util.Collection)

getChildDevices

@JSONProperty(ignoreIfNull=true)
@JSONConverter(type=IDListTypeConverter.class)
public Set<T> getChildDevices()
Returns:
the childDevices

setChildDevices

public void setChildDevices(Collection<T> devices)
Replaces the underlying devices set with a new synchronized set containing the elements passed in the parameter. Keeps the underlying set synchronized to ensure thread safety and avoid race conditions. A setter method for a Set with a Collection as the parameter is the most useful setter for all third parties, but unfortunately it can not used by SVENSON, and that's the reason there is a specific setter using a Set as the parameter.

Parameters:
Devices -

setChildDevices

public void setChildDevices(Set<T> devices)
Replaces the underlying devices set with a new synchronized set containing the elements passed in the parameter. Keeps the underlying set synchronized to ensure thread safety and avoid race conditions. Do not remove this method, it is required by SVENSON!

Parameters:
devices -
See Also:
setChildDevices(final Collection devices)

addChildDevice

public boolean addChildDevice(T e)
Adds a ManagedObjectId as a child device


addAllChildDevices

public boolean addAllChildDevices(Collection<T> c)
Adds a collection of ManagedObjectId as child devices


removeChildDevice

public boolean removeChildDevice(T o)
Removes a ManagedObjectId from the child devices set

Parameters:
o - the ManagedObjectId to remove
Returns:
true if the underlying set was modified
See Also:
Set.remove(java.lang.Object)

removeAllChildDevices

public boolean removeAllChildDevices(Collection<T> c)
Removes a collection of ManagedObjectId from the child devices set

Parameters:
c - the collection of ManagedObjectId to remove
Returns:
true if the underlying set was modified
See Also:
Set.removeAll(java.util.Collection)

hashCode

public int hashCode()
Autogenerated by Eclipse

Overrides:
hashCode in class Document<T extends ID>

equals

public boolean equals(Object obj)
Autogenerated by Eclipse

Overrides:
equals in class Document<T extends ID>

fromJSON

public static ManagedObject fromJSON(String json)
Unmarshall the JSON representation to ManagedObject type.

Parameters:
json - the json string
Returns:
the ManagedObject representation.


Copyright © 2013 (C) Cumulocity GmbH. All Rights Reserved.