Package org.symphonyoss.s2.canon.runtime
Class Entity
- java.lang.Object
-
- org.symphonyoss.s2.canon.runtime.BaseEntity
-
- org.symphonyoss.s2.canon.runtime.Entity
-
- All Implemented Interfaces:
IBaseEntity,IEntity,IEntityOrBuilder,org.symphonyoss.s2.common.dom.json.IJsonDomNodeProvider
public class Entity extends BaseEntity implements IEntity
Base class for all generated object classes in a Canon model.- Author:
- Bruce Skingle
-
-
Constructor Summary
Constructors Constructor Description Entity(IEntity canonOther)Constructor from another instance, usually a Builder.Entity(IEntityBuilder canonOther)Constructor from another instance, usually a Builder.Entity(org.symphonyoss.s2.common.dom.json.ImmutableJsonObject jsonObject, IModelRegistry modelRegistry)Constructor from serialized form.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetCanonMajorVersion()IntegergetCanonMinorVersion()StringgetCanonType()Return the type identifier (_type JSON attribute) for this entity.com.google.common.collect.ImmutableSet<String>getCanonUnknownKeys()The set of keys present in the JSON from which this object was deserialized which are not defined by the schema.org.symphonyoss.s2.common.dom.json.ImmutableJsonObjectgetJsonObject()Return the JSON object from which this entity was created.-
Methods inherited from class org.symphonyoss.s2.canon.runtime.BaseEntity
equals, getJsonDomNode, hashCode, serialize, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.symphonyoss.s2.canon.runtime.IBaseEntity
getJsonDomNode, serialize
-
-
-
-
Constructor Detail
-
Entity
public Entity(org.symphonyoss.s2.common.dom.json.ImmutableJsonObject jsonObject, IModelRegistry modelRegistry)Constructor from serialized form.- Parameters:
jsonObject- A parse tree of the serialized form.modelRegistry- A model registry to use to deserialize any nested objects.
-
Entity
public Entity(IEntity canonOther)
Constructor from another instance, usually a Builder.- Parameters:
canonOther- Another entity containing all values for the required object. This is usually a Builder.
-
Entity
public Entity(IEntityBuilder canonOther)
Constructor from another instance, usually a Builder.- Parameters:
canonOther- Another entity containing all values for the required object. This is usually a Builder.
-
-
Method Detail
-
getJsonObject
public org.symphonyoss.s2.common.dom.json.ImmutableJsonObject getJsonObject()
Description copied from interface:IEntityOrBuilderReturn the JSON object from which this entity was created.- Specified by:
getJsonObjectin interfaceIEntityOrBuilder- Returns:
- the JSON object from which this entity was created.
-
getCanonType
@Nonnull public String getCanonType()
Description copied from interface:IEntityOrBuilderReturn the type identifier (_type JSON attribute) for this entity.- Specified by:
getCanonTypein interfaceIEntityOrBuilder- Returns:
- The type identifier for this object.
-
getCanonMajorVersion
@Nullable public Integer getCanonMajorVersion()
- Specified by:
getCanonMajorVersionin interfaceIEntityOrBuilder- Returns:
- The major part of the canon schema version defining this object.
-
getCanonMinorVersion
@Nullable public Integer getCanonMinorVersion()
- Specified by:
getCanonMinorVersionin interfaceIEntityOrBuilder- Returns:
- The minor part of the canon schema version defining this object.
-
getCanonUnknownKeys
public com.google.common.collect.ImmutableSet<String> getCanonUnknownKeys()
Description copied from interface:IEntityThe set of keys present in the JSON from which this object was deserialized which are not defined by the schema. In the case where an object extends some other object the super-class unknown keys will include all keys defined by the current class.- Specified by:
getCanonUnknownKeysin interfaceIEntity- Returns:
- The set of unknown keys in the JSON from which this object was deserialized;
-
-