@Deprecated public class MemoryDataView extends Object implements DataView
DataView
being used in memory.DataView.SafetyMode
Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
map
Deprecated.
|
Modifier | Constructor and Description |
---|---|
protected |
MemoryDataView(DataView.SafetyMode safety)
Deprecated.
|
protected |
MemoryDataView(DataView parent,
DataQuery path,
DataView.SafetyMode safety)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(DataQuery path)
Deprecated.
Returns whether this
DataView contains the given path. |
boolean |
contains(DataQuery path,
DataQuery... paths)
Deprecated.
|
DataContainer |
copy()
Deprecated.
Copies this
DataView and all of it's contents into a new
DataContainer . |
DataContainer |
copy(DataView.SafetyMode safety)
Deprecated.
Copies this
DataView and all of it's contents into a new
DataContainer with the given safety mode. |
DataView |
createView(DataQuery path)
Deprecated.
Creates a new
DataView at the desired path. |
DataView |
createView(DataQuery path,
Map<?,?> map)
Deprecated.
Creates a new
DataView with the given data at the desired
path. |
boolean |
equals(Object obj)
Deprecated.
|
Optional<Object> |
get(DataQuery path)
Deprecated.
Gets an object from the desired path.
|
Optional<Boolean> |
getBoolean(DataQuery path)
Deprecated.
Gets the
Boolean by path, if available. |
Optional<List<Boolean>> |
getBooleanList(DataQuery path)
Deprecated.
|
Optional<Byte> |
getByte(DataQuery path)
Deprecated.
Gets the
Byte by path, if available. |
Optional<List<Byte>> |
getByteList(DataQuery path)
Deprecated.
|
<T extends CatalogType> |
getCatalogType(DataQuery path,
Class<T> catalogType)
Deprecated.
Gets the
CatalogType object by path, if available. |
<T extends CatalogType> |
getCatalogTypeList(DataQuery path,
Class<T> catalogType)
Deprecated.
Gets the
List of CatalogType s by path, if available. |
Optional<List<Character>> |
getCharacterList(DataQuery path)
Deprecated.
|
DataContainer |
getContainer()
Deprecated.
Gets the parent container of this DataView.
|
DataQuery |
getCurrentPath()
Deprecated.
Gets the current path of this
DataView from its root
DataContainer . |
Optional<Double> |
getDouble(DataQuery path)
Deprecated.
Gets the
Double by path, if available. |
Optional<List<Double>> |
getDoubleList(DataQuery path)
Deprecated.
|
Optional<Float> |
getFloat(DataQuery path)
Deprecated.
Gets the
Float by path, if available. |
Optional<List<Float>> |
getFloatList(DataQuery path)
Deprecated.
|
Optional<Integer> |
getInt(DataQuery path)
Deprecated.
Gets the
Integer by path, if available. |
Optional<List<Integer>> |
getIntegerList(DataQuery path)
Deprecated.
|
Set<DataQuery> |
getKeys(boolean deep)
Deprecated.
Gets a collection containing all keys in this
DataView . |
Optional<List<?>> |
getList(DataQuery path)
Deprecated.
Gets the
List of something by path, if available. |
Optional<Long> |
getLong(DataQuery path)
Deprecated.
Gets the
Long by path, if available. |
Optional<List<Long>> |
getLongList(DataQuery path)
Deprecated.
|
Optional<? extends Map<?,?>> |
getMap(DataQuery path)
Deprecated.
Gets the underlying
Map by path, if available. |
Optional<List<Map<?,?>>> |
getMapList(DataQuery path)
Deprecated.
|
String |
getName()
Deprecated.
Gets the name of this individual
DataView in the path. |
<T> Optional<T> |
getObject(DataQuery path,
Class<T> objectClass)
Deprecated.
Gets the
Object object by path, if available. |
<T> Optional<List<T>> |
getObjectList(DataQuery path,
Class<T> objectClass)
Deprecated.
Gets the
List of DataSerializable by path, if available. |
Optional<DataView> |
getParent()
Deprecated.
Gets the parent
DataView of this view. |
DataView.SafetyMode |
getSafetyMode()
Deprecated.
Gets the
DataView.SafetyMode of this data view. |
<T extends DataSerializable> |
getSerializable(DataQuery path,
Class<T> clazz)
Deprecated.
Gets the
DataSerializable object by path, if available. |
<T extends DataSerializable> |
getSerializableList(DataQuery path,
Class<T> clazz)
Deprecated.
Gets the
List of DataSerializable by path, if available. |
Optional<Short> |
getShort(DataQuery path)
Deprecated.
Gets the
Short by path, if available. |
Optional<List<Short>> |
getShortList(DataQuery path)
Deprecated.
|
Optional<String> |
getString(DataQuery path)
Deprecated.
Gets the
String by path, if available. |
Optional<List<String>> |
getStringList(DataQuery path)
Deprecated.
|
Map<DataQuery,Object> |
getValues(boolean deep)
Deprecated.
Gets a Map containing all keys and their values for this
DataView . |
Optional<DataView> |
getView(DataQuery path)
Deprecated.
Gets the
DataView by path, if available. |
Optional<List<DataView>> |
getViewList(DataQuery path)
Deprecated.
|
int |
hashCode()
Deprecated.
|
boolean |
isEmpty()
Deprecated.
Gets if this view contains no data.
|
DataView |
remove(DataQuery path)
Deprecated.
Removes the data associated to the given path relative to this
DataView 's path. |
DataView |
set(DataQuery path,
Object value)
Deprecated.
Sets the given Object value according to the given path relative to
this
DataView 's path. |
<E> DataView |
set(Key<? extends BaseValue<E>> key,
E value)
Deprecated.
|
String |
toString()
Deprecated.
|
protected MemoryDataView(DataView.SafetyMode safety)
protected MemoryDataView(DataView parent, DataQuery path, DataView.SafetyMode safety)
public DataContainer getContainer()
DataView
Every DataView will always have a DataContainer
.
For any DataContainer
, this will return itself.
getContainer
in interface DataView
public DataQuery getCurrentPath()
DataView
DataView
from its root
DataContainer
.
For any DataContainer
itself, this will return an
empty string as it is the root of the path.
The full path will always include this DataView
s name
at the end of the path.
getCurrentPath
in interface DataView
public String getName()
DataView
DataView
in the path.
This will always be the final substring of the full path
from DataView.getCurrentPath()
.
public Optional<DataView> getParent()
DataView
DataView
of this view. The parent directly
contains this view according to the DataView.getCurrentPath()
.
For any DataContainer
, this will return an absent parent.
public Set<DataQuery> getKeys(boolean deep)
DataView
DataView
.
If deep is set to true, then this will contain all the keys
within any child DataView
s (and their children, etc).
These will be in a valid path notation for you to use.
If deep is set to false, then this will contain only the keys of any direct children, and not their own children.
public Map<DataQuery,Object> getValues(boolean deep)
DataView
DataView
.
If deep is set to true, then this will contain all the keys and
values within any child DataView
s (and their children,
etc). These keys will be in a valid path notation for you to use.
If deep is set to false, then this will contain only the keys and values of any direct children, and not their own children.
public final boolean contains(DataQuery path)
DataView
DataView
contains the given path.public boolean contains(DataQuery path, DataQuery... paths)
DataView
public Optional<Object> get(DataQuery path)
DataView
public DataView set(DataQuery path, Object value)
DataView
DataView
's path.public <E> DataView set(Key<? extends BaseValue<E>> key, E value)
DataView
public DataView remove(DataQuery path)
DataView
public DataView createView(DataQuery path)
DataView
DataView
at the desired path.
If any data existed at the given path, that data will be
overwritten with the newly constructed DataView
.
createView
in interface DataView
path
- The path of the new viewpublic DataView createView(DataQuery path, Map<?,?> map)
DataView
DataView
with the given data at the desired
path.
If any data existed at the given path, that data will be overwritten
with the newly constructed DataView
.
createView
in interface DataView
path
- The path of the new viewmap
- The data to store in the new viewpublic Optional<DataView> getView(DataQuery path)
DataView
public Optional<? extends Map<?,?>> getMap(DataQuery path)
DataView
public Optional<Boolean> getBoolean(DataQuery path)
DataView
Boolean
by path, if available.
If a Boolean
does not exist, or the data residing at
the path is not an instance of a Boolean
, an absent is
returned.
getBoolean
in interface DataView
path
- The path of the value to getpublic Optional<Byte> getByte(DataQuery path)
DataView
public Optional<Short> getShort(DataQuery path)
DataView
public Optional<Integer> getInt(DataQuery path)
DataView
public Optional<Long> getLong(DataQuery path)
DataView
public Optional<Float> getFloat(DataQuery path)
DataView
public Optional<Double> getDouble(DataQuery path)
DataView
public Optional<String> getString(DataQuery path)
DataView
public Optional<List<?>> getList(DataQuery path)
DataView
public Optional<List<String>> getStringList(DataQuery path)
DataView
List
of String
by path, if available.
If a List
of String
does not exist, or the data
residing at the path is not an instance of a List
of
String
, an absent is returned.
getStringList
in interface DataView
path
- The path of the value to getpublic Optional<List<Character>> getCharacterList(DataQuery path)
DataView
List
of Character
by path, if available.
If a List
of Character
does not exist, or the data
residing at the path is not an instance of a List
of
Character
, an absent is returned.
getCharacterList
in interface DataView
path
- The path of the value to getpublic Optional<List<Boolean>> getBooleanList(DataQuery path)
DataView
List
of Boolean
by path, if available.
If a List
of Boolean
does not exist, or the data
residing at the path is not an instance of a List
of
Boolean
, an absent is returned.
getBooleanList
in interface DataView
path
- The path of the value to getpublic Optional<List<Byte>> getByteList(DataQuery path)
DataView
List
of Byte
by path, if available.
If a List
of Byte
does not exist, or the data
residing at the path is not an instance of a List
of
Byte
, an absent is returned.
getByteList
in interface DataView
path
- The path of the value to getpublic Optional<List<Short>> getShortList(DataQuery path)
DataView
List
of Short
by path, if available.
If a List
of Short
does not exist, or the data
residing at the path is not an instance of a List
of
Short
, an absent is returned.
getShortList
in interface DataView
path
- The path of the value to getpublic Optional<List<Integer>> getIntegerList(DataQuery path)
DataView
List
of Integer
by path, if available.
If a List
of Integer
does not exist, or the data
residing at the path is not an instance of a List
of
Integer
, an absent is returned.
getIntegerList
in interface DataView
path
- The path of the value to getpublic Optional<List<Long>> getLongList(DataQuery path)
DataView
List
of Long
by path, if available.
If a List
of Long
does not exist, or the data
residing at the path is not an instance of a List
of
Long
, an absent is returned.
getLongList
in interface DataView
path
- The path of the value to getpublic Optional<List<Float>> getFloatList(DataQuery path)
DataView
List
of Float
by path, if available.
If a List
of Float
does not exist, or the data
residing at the path is not an instance of a List
of
Float
, an absent is returned.
getFloatList
in interface DataView
path
- The path of the value to getpublic Optional<List<Double>> getDoubleList(DataQuery path)
DataView
List
of Double
by path, if available.
If a List
of Double
does not exist, or the data
residing at the path is not an instance of a List
of
Double
, an absent is returned.
getDoubleList
in interface DataView
path
- The path of the value to getpublic Optional<List<Map<?,?>>> getMapList(DataQuery path)
DataView
List
of Map
by path, if available.
If a List
of Map
does not exist, or the data
residing at the path is not an instance of a List
of
Map
, an absent is returned.
getMapList
in interface DataView
path
- The path of the value to getpublic Optional<List<DataView>> getViewList(DataQuery path)
DataView
List
of DataView
by path, if available.
If a List
of DataView
does not exist, or the data
residing at the path is not an instance of a List
of
DataView
, an absent is returned.
getViewList
in interface DataView
path
- The path of the value to getpublic <T extends DataSerializable> Optional<T> getSerializable(DataQuery path, Class<T> clazz)
DataView
DataSerializable
object by path, if available.
If a DataSerializable
exists, but is not the proper class
type, or there is no data at the path given, an absent is returned.
It is important that the DataManager
provided is
the same one that has registered many of the
DataBuilder
s to ensure the DataSerializable
requested can be returned.
getSerializable
in interface DataView
T
- The type of DataSerializable
objectpath
- The path of the value to getclazz
- The class of the DataSerializable
public <T extends DataSerializable> Optional<List<T>> getSerializableList(DataQuery path, Class<T> clazz)
DataView
List
of DataSerializable
by path, if available.
If a List
exists, but the contents of the list are not
considered DataSerializable
or are not of the proper type of
DataSerializable
, an absent is returned.
It is important that the DataManager
provided is
the same one that has registered many of the
DataBuilder
s to ensure the DataSerializable
requested can be returned.
getSerializableList
in interface DataView
T
- The type of DataSerializable
objectpath
- The path of the list value to getclazz
- The class of the DataSerializable
public <T extends CatalogType> Optional<T> getCatalogType(DataQuery path, Class<T> catalogType)
DataView
CatalogType
object by path, if available.
If a CatalogType
exists, but is not named properly, not
existing in a registry, or simply an invalid value will return
an empty value.
getCatalogType
in interface DataView
T
- The type of dummypath
- The path of the value to getcatalogType
- The class of the dummy typepublic <T extends CatalogType> Optional<List<T>> getCatalogTypeList(DataQuery path, Class<T> catalogType)
DataView
List
of CatalogType
s by path, if available.
If a List
exists, but contents of the list are not
considered CatalogType
s or are not of the proper type
of CatalogType
, an absent is returned.
getCatalogTypeList
in interface DataView
T
- The type of dummy typepath
- The path of the list value to getcatalogType
- The class of the dummy typepublic <T> Optional<T> getObject(DataQuery path, Class<T> objectClass)
DataView
Object
object by path, if available.
If a Object
exists, but is not the proper class
type, or there is no data at the path given, an absent is returned.
It is important that the DataManager
provided is
the same one that has registered many of the
DataTranslator
s to ensure the DataSerializable
requested can be returned.
public <T> Optional<List<T>> getObjectList(DataQuery path, Class<T> objectClass)
DataView
List
of DataSerializable
by path, if available.
If a List
exists, but the contents of the list are not
considered DataTranslator
"able" or are not of the proper type of
DataTranslator
, an absent is returned.
It is important that the DataManager
provided is
the same one that has registered many of the
DataTranslator
s to ensure the Object
requested can be returned.
getObjectList
in interface DataView
T
- The type of Object
objectpath
- The path of the value to getobjectClass
- The class of the Object
public DataContainer copy()
DataView
DataView
and all of it's contents into a new
DataContainer
.
Note that the copy will not have the same path as this
DataView
since it will be constructed with the top level path
being itself.
public DataContainer copy(DataView.SafetyMode safety)
DataView
DataView
and all of it's contents into a new
DataContainer
with the given safety mode.
Note that the copy will not have the same path as this
DataView
since it will be constructed with the top level path
being itself.
public boolean isEmpty()
DataView
public DataView.SafetyMode getSafetyMode()
DataView
DataView.SafetyMode
of this data view.getSafetyMode
in interface DataView