public static class EmptyInventory.DatasSingle extends Object implements Data.Single
| Constructor and Description |
|---|
DatasSingle() |
| Modifier and Type | Method and Description |
|---|---|
StructuredData |
data(RelativePath dataPath)
Returns the data on the path relative to the entity.
|
void |
delete()
Deletes the entity.
|
DataEntity |
entity()
Loads the data entity on the current position in the inventory traversal along with its data.
|
StructuredData |
flatData(RelativePath dataPath)
This is very similar to
Data.Single.data(RelativePath) but this method doesn't load the child data. |
void |
update(DataEntity.Update update)
Updates the entity.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexistspublic StructuredData flatData(RelativePath dataPath)
Data.SingleData.Single.data(RelativePath) but this method doesn't load the child data.
If the data on the path contains a "primitive" value, the value is loaded. If the data contains a list, the returned instance will contain an empty list and if the data contains a map the returned instance will contain an empty map.
flatData in interface Data.SingledataPath - the path to the subset of the data to returnpublic DataEntity entity() throws EntityNotFoundException
Data.SingleNote that this might be a potentially expensive operation because of the attached data structure being loaded.
entity in interface Data.Singleentity in interface ResolvableToSingle<DataEntity,DataEntity.Update>EntityNotFoundException - if there is no structured data on the current position in the inventoryResolvableToSingle.entity()public StructuredData data(RelativePath dataPath)
Data.SingleI.e if you have an data entity which contains a map with a key "foo", which contains a list and you
want to obtain a third element of that list, you'd do:
...data(RelativePath.to().structuredData().key("foo").index(2).get());
If you want to obtain the whole data structure, use an empty path: RelativePath.empty().get().
data in interface Data.SingledataPath - the path to the subset of the data.Data.Single.flatData(RelativePath)public void update(DataEntity.Update update) throws EntityNotFoundException, RelationNotFoundException
ResolvableToSingleupdate in interface Data.Singleupdate in interface ResolvableToSingle<DataEntity,DataEntity.Update>update - the update to be appliedEntityNotFoundException - if there is no entity corresponding to the traversalRelationNotFoundException - if there is no relation corresponding to the traversalpublic void delete()
ResolvableToSingledelete in interface ResolvableToSingle<DataEntity,DataEntity.Update>Copyright © 2015 Red Hat, Inc.. All rights reserved.