Package com.cumulocity.model
Class Document<T extends ID>
java.lang.Object
org.svenson.AbstractDynamicProperties
com.cumulocity.model.JSONBase
com.cumulocity.model.Document<T>
- All Implemented Interfaces:
Serializable
,org.svenson.DynamicProperties
Represents the common elements of any modeled entity. Can serialize into and
be deserialized from JSON.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.cumulocity.model.JSONBase
JSONBase.JSONGeneratorBuilder, JSONBase.JSONParserBuilder, JSONBase.ReaderJSONCharacterSource
-
Field Summary
Fields inherited from class com.cumulocity.model.JSONBase
ID_TYPE_CONVERTER_NAME
-
Constructor Summary
ModifierConstructorDescriptionprotected
Document()
protected
protected
protected
protected
protected
-
Method Summary
Modifier and TypeMethodDescriptionvoid
asId()
static <E extends org.svenson.AbstractDynamicProperties>
EcopyDynamicProperties
(org.svenson.AbstractDynamicProperties source, E target) static <E extends org.svenson.AbstractDynamicProperties>
EcopyDynamicProperties
(org.svenson.AbstractDynamicProperties source, E target, DynamicPropertiesFilter filter) static <E extends org.svenson.AbstractDynamicProperties>
EdeepCopyDynamicProperties
(org.svenson.AbstractDynamicProperties source, E target) boolean
<C> C
Returns the object whose parameter name is given by clazz, or null if no such property exists, or property cannot be cased to clazz.Returns the object associated with the given property name, or null if no such property exists.<C> C
getFragment
(String name) Returns the object associated with the given property name, or null if no such property exists.getId()
Deprecated.Deprecated.int
hashCode()
protected <C> C
readObject
(Object source, Class<C> asClass) void
Remove the fragment whose name is given by clazz if existsvoid
Sets a property referring to the given object.<C> void
Sets a property referring to the given object.void
Sets a property referring to the given object, using an arbitrary property name.void
void
setInternalId
(String internalId) Deprecated.void
setRevision
(String revision) Deprecated.toString()
Methods inherited from class com.cumulocity.model.JSONBase
fromJSON, fromJSON, getJSONGenerator, getJSONGeneratorWithUTF8Encoding, getJSONParser, toJSON
Methods inherited from class org.svenson.AbstractDynamicProperties
getAttrs, getProperty, hasProperty, propertyNames, removeProperty, setProperty
-
Field Details
-
acceptAll
-
-
Constructor Details
-
Document
protected Document() -
Document
-
Document
-
Document
-
Document
-
Document
-
-
Method Details
-
copyDynamicProperties
public static <E extends org.svenson.AbstractDynamicProperties> E copyDynamicProperties(org.svenson.AbstractDynamicProperties source, E target, DynamicPropertiesFilter filter) -
copyDynamicProperties
public static <E extends org.svenson.AbstractDynamicProperties> E copyDynamicProperties(org.svenson.AbstractDynamicProperties source, E target) -
deepCopyDynamicProperties
public static <E extends org.svenson.AbstractDynamicProperties> E deepCopyDynamicProperties(org.svenson.AbstractDynamicProperties source, E target) -
getId
@JSONProperty(value="id", ignoreIfNull=true) @JSONConverter(type=IDTypeConverter.class) public T getId() -
setId
-
getInternalId
Deprecated. -
setInternalId
Deprecated. -
getRevision
Deprecated. -
setRevision
Deprecated. -
set
Sets a property referring to the given object. The name of the property will be the fully qualified class name with dots replaced by underscores.
For example, if the object is of type:
com.cumulocity.model.Coordinate
then the property name will be:
"com_cumulocity_model_Coordinate"
- Parameters:
object
-
-
set
Sets a property referring to the given object, using an arbitrary property name.- Parameters:
object
-propertyName
-
-
set
Sets a property referring to the given object. The name of the property will be the fully qualified class name of the given class, with dots replaced by underscores.
This can be useful if you want to name the property after the base class rather than the actual class of object.
For example, if clazz is of type:
com.cumulocity.model.Coordinate
then the property name will be:
"com_cumulocity_model_Coordinate"
- Parameters:
object
-clazz
-
-
add
-
get
Returns the object whose parameter name is given by clazz, or null if no such property exists, or property cannot be cased to clazz.- Parameters:
clazz
-- Returns:
- See Also:
-
get
-
readObject
-
remove
Remove the fragment whose name is given by clazz if exists- Parameters:
clazz
-
-
get
Returns the object associated with the given property name, or null if no such property exists.- Parameters:
name
-- Returns:
-
getFragment
Returns the object associated with the given property name, or null if no such property exists. Such an accessor is required when bean naming conventions are used to discover available properties. Same as a call toget(String name)
- Parameters:
name
-- Returns:
-
hashCode
public int hashCode() -
equals
-
toString
-
asId
-