public interface PlasmaDataObject extends DataObject
data graph.
Each data object holds its data as a series of Properties.
Properties can be accessed by name, property index, or using the property meta object itself.
A data object can also contain references to other data objects, through reference-type Properties.
A data object has a series of convenience accessors for its Properties.
These methods either use a path (String),
a property index,
or the property's meta object itself, to identify the property.
Some examples of the path-based accessors are as follows:
DataObject company = ...;
company.get("name"); is the same as company.get(company.getType().getProperty("name"))
company.set("name", "acme");
company.get("department.0/name") is the same as ((DataObject)((List)company.get("department")).get(0)).get("name")
.n indexes from 0 ... implies the name property of the first department
company.get("department[1]/name") [] indexes from 1 ... implies the name property of the first department
company.get("department[number=123]") returns the first department where number=123
company.get("..") returns the containing data object
company.get("/") returns the root containing data object
There are general accessors for Properties, i.e., get and set,
as well as specific accessors for the primitive types and commonly used data types like
String, Date, List, BigInteger, and BigDecimal.
| Modifier and Type | Method and Description |
|---|---|
void |
accept(PlasmaDataGraphEventVisitor visitor)
Begin breadth-first traversal of a DataGraph with this DataObject as the
graph root, the given visitor receiving various events for each graph
node traversed.
|
void |
accept(PlasmaDataGraphVisitor visitor)
Begin breadth-first traversal of a DataGraph with this DataObject as the graph root, the given
visitor receiving "visit" events for each graph node traversed.
|
void |
accept(PlasmaDataGraphVisitor visitor,
int maxLevel)
Begin breadth-first traversal of a DataGraph with this DataObject as the graph root, the given
visitor receiving "visit" events for each graph node traversed.
|
void |
acceptDepthFirst(PlasmaDataGraphVisitor visitor)
Begin depth-first traversal of a DataGraph with this DataObject as the graph root, the given
visitor receiving "visit" events for each graph node traversed.
|
void |
add(Property property,
Object value)
Adds the given value to the given multi=valued property.
|
boolean |
contains(DataObject dataObject)
Returns true if this data object is the container for the
given data object.
|
String |
dump() |
String |
dumpDepthFirst() |
DataObject |
find(String key) |
PlasmaDataObject |
getDataObject() |
UUID |
getUUID()
Returns the UUID for this data object.
|
String |
getUUIDAsString()
Returns the UUID for this data object as a
character string.
|
void |
remove() |
void |
remove(Property property,
Object value)
Removes the given value from this data object for
the given multi-valued property.
|
void |
reparent(PlasmaDataObject container,
Property containmentProperty)
Deprecated.
|
void |
reset(SnapshotMap commitMap,
String username)
Synchronizes the state of this data object to that of it's data store
given the map of UUID's and associated info resulting from
a successful commit.
|
void |
resetUUID(UUID uuid)
Resets the UUID after creation for cases where the UUID
is stored externally and services creating data objects
need to preserve the stored UUIDs across service calls.
|
void |
setContainer(DataObject container)
Deprecated.
|
void |
setContainmentProperty(Property containmentProperty)
Deprecated.
|
void |
setDataGraph(DataGraph dataGraph)
Deprecated.
|
createDataObject, createDataObject, createDataObject, createDataObject, createDataObject, createDataObject, delete, detach, get, get, get, getBigDecimal, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getBytes, getBytes, getBytes, getChangeSummary, getChar, getChar, getChar, getContainer, getContainmentProperty, getDataGraph, getDataObject, getDataObject, getDataObject, getDate, getDate, getDate, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInstanceProperties, getInstanceProperty, getInt, getInt, getInt, getList, getList, getList, getLong, getLong, getLong, getProperty, getRootObject, getSequence, getSequence, getSequence, getSequence, getShort, getShort, getShort, getString, getString, getString, getType, isSet, isSet, isSet, set, set, set, setBigDecimal, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBigInteger, setBoolean, setBoolean, setBoolean, setByte, setByte, setByte, setBytes, setBytes, setBytes, setChar, setChar, setChar, setDataObject, setDataObject, setDataObject, setDate, setDate, setDate, setDouble, setDouble, setDouble, setFloat, setFloat, setFloat, setInt, setInt, setInt, setList, setList, setList, setLong, setLong, setLong, setShort, setShort, setShort, setString, setString, setString, unset, unset, unset@Deprecated void setDataGraph(DataGraph dataGraph)
@Deprecated void setContainer(DataObject container)
@Deprecated void setContainmentProperty(Property containmentProperty)
containmentProperty - the containment property, which must be a declared property
within the type for the current container data object.@Deprecated void reparent(PlasmaDataObject container, Property containmentProperty)
data object to another data graph, makes this data object to
be contained by the given container
data object using the given containment property. The property and
its opposite if exists, are automatically set and flagged as modified
in the change summary. This data object automatically
becomes part of the data graph of the given container.container - the container data object.containmentProperty - the containment property, which must be a declared property
within the type for the given container data object.void add(Property property, Object value)
property - the multi-valued propertyvalue - the value to add - can be a list of valuesvoid remove(Property property, Object value)
property - multi-valued the propertyvalue - the value to removeUnsupportedOperationException - if the given property
is not multi-valuedvoid reset(SnapshotMap commitMap, String username)
commitMap - - the map of UUID's mapped to, e.g. data store
generated sequence numbers.username - - the user who committed the modifications.void remove()
boolean contains(DataObject dataObject)
dataObject - the data objectUUID getUUID()
void resetUUID(UUID uuid)
uuid - the UUIDString getUUIDAsString()
PlasmaDataObject getDataObject()
void accept(PlasmaDataGraphVisitor visitor)
visitor - the graph visitor receiving traversal eventsDataGraph,
DataObject,
PlasmaDataGraph,
PlasmaDataObject,
PlasmaDataGraphVisitor.visit()void accept(PlasmaDataGraphVisitor visitor, int maxLevel)
visitor - the graph visitor receiving traversal eventsmaxLevel - the maximum number of "hierarchical" levels to traverseDataGraph,
DataObject,
PlasmaDataGraph,
PlasmaDataObject,
PlasmaDataGraphVisitor.visit()void acceptDepthFirst(PlasmaDataGraphVisitor visitor)
visitor - the graph visitor receiving traversal eventsDataGraph,
DataObject,
PlasmaDataGraph,
PlasmaDataObject,
PlasmaDataGraphVisitor.visit()void accept(PlasmaDataGraphEventVisitor visitor)
visitor - the graph visitor receiving traversal eventsDataGraph,
DataObject,
PlasmaDataGraph,
PlasmaDataObject,
PlasmaDataGraphVisitor.visit()DataObject find(String key)
String dump()
String dumpDepthFirst()
Copyright © 2017. All rights reserved.