public class OInstance extends OGroup implements MutableInstance
ODocument
sModifier and Type | Field and Description |
---|---|
static String |
FIELD_INSERTED
Name for the special field indicating if the instance was inserted
directly.
|
static String |
FIELD_METADATA
Name for the special field for MetaData documents
|
static String |
FIELD_VALUE
Name for the special field for an instance value
|
Constructor and Description |
---|
OInstance(Instance org)
Copy constructor.
|
OInstance(com.orientechnologies.orient.core.record.impl.ODocument document,
TypeDefinition typeDef,
com.orientechnologies.orient.core.db.record.ODatabaseRecord db,
DataSet dataSet)
Creates an instance based on the given document.
|
OInstance(TypeDefinition typeDef,
DataSet dataSet)
Creates an empty instance associated with the given type.
|
Modifier and Type | Method and Description |
---|---|
DataSet |
getDataSet()
Get the data set the instance is associated to.
|
TypeDefinition |
getDefinition()
Get the group definition
|
List<Object> |
getMetaData(String key)
Get the metadata the instance my be associated with
|
Set<String> |
getMetaDataNames()
Get all keys the metadata is associated with
|
protected Collection<String> |
getSpecialFieldNames()
Get the special field names, e.g.
|
Object |
getValue()
Get the instance value.
The value is only present for certain types where the HasValueFlag or AugmentedValueFlag constraint is enabled. |
boolean |
isInserted()
States if the instance was inserted directly.
|
void |
putMetaData(String key,
Object obj)
add Data to the MetaData, which the Instance can be associated with If
there is no MetaData in the Instance, a new container will be created
|
void |
setDataSet(DataSet dataSet)
Set the data set the instance is associated to.
|
void |
setInserted(boolean inserted)
Set if the instance is inserted directly.
|
void |
setMetaData(String key,
Object... values)
Sets the metadata of a certain key, may also delet or reset the value of
the key if the values parameter is null or empty
|
void |
setValue(Object value)
Set the instance value.
|
addProperty, addProperty, associatedDbWithThread, configureDocument, convertDocument, convertInstance, decodeProperty, encodeProperty, getDb, getDocument, getProperty, getProperty, getPropertyNames, getPropertyNames, setProperty, setPropertyInternal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addProperty, setProperty
getProperty, getPropertyNames
public static final String FIELD_VALUE
public static final String FIELD_METADATA
public static final String FIELD_INSERTED
public OInstance(TypeDefinition typeDef, DataSet dataSet)
typeDef
- the definition of the instance's typedataSet
- the data set the instance is associated topublic OInstance(com.orientechnologies.orient.core.record.impl.ODocument document, TypeDefinition typeDef, com.orientechnologies.orient.core.db.record.ODatabaseRecord db, DataSet dataSet)
document
- the documenttypeDef
- the definition of the instance's typedb
- the databasedataSet
- the data set the instance is associated topublic OInstance(Instance org)
org
- the instance to copypublic void setValue(Object value)
MutableInstance
Instance
.setValue
in interface MutableInstance
value
- the instance value to setMutableInstance.setValue(Object)
public Object getValue()
Instance
HasValueFlag
or AugmentedValueFlag
constraint is enabled.
The Binding
constraint on the type definition defines the binding
of the value.Group
or Instance
).getValue
in interface Instance
null
Instance.getValue()
public void setInserted(boolean inserted)
inserted
- if the instance is inserted directly.public boolean isInserted()
protected Collection<String> getSpecialFieldNames()
OGroup
getSpecialFieldNames
in class OGroup
OGroup.getSpecialFieldNames()
public TypeDefinition getDefinition()
Group
getDefinition
in interface Group
getDefinition
in interface Instance
getDefinition
in class OGroup
Instance.getDefinition()
public DataSet getDataSet()
Instance
getDataSet
in interface Instance
null
if not setpublic void setDataSet(DataSet dataSet)
MutableInstance
setDataSet
in interface MutableInstance
dataSet
- the instance data setpublic List<Object> getMetaData(String key)
Instance
getMetaData
in interface Instance
key
- the key to access a certain metadataInstance.getMetaData(java.lang.String)
public void putMetaData(String key, Object obj)
putMetaData
in interface MutableInstance
key
- a key the data to add will be associated withobj
- the Data to add, may not be Instance
or Group
public Set<String> getMetaDataNames()
Instance
getMetaDataNames
in interface Instance
Instance.getMetaDataNames()
public void setMetaData(String key, Object... values)
setMetaData
in interface MutableInstance
key
- the key the data is associated withvalues
- the values to set, may not contain Instance
or
Group
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a