- All Superinterfaces:
AbstractData<K,,V> ContentOnlyData<K,,V> Datable,Iterable<Entry<K,V>>
- All Known Subinterfaces:
SAODataWrapper<O>,SODataWrapper
- All Known Implementing Classes:
SAODataWrapperImpl,SODataWrapperImpl
a data wrapper wraps a single object inside a
When parsed a normal
This is not always useful. For example when parsing an array to a json-array without a json-object around it. That the use case of the
That is why a
AbstractData.
When parsed a normal
AbstractData will be parsed to a json-object. That means it will start with
a "{".
This is not always useful. For example when parsing an array to a json-array without a json-object around it. That the use case of the
DataWrapper. It will parse the object it is wrapping without adding a json-object around it.
That is why a
DataWrapper can only have a single Entry at a time. Adding or removing this will throw an
UnsupportedOperationException- See Also:
-
Field Summary
Fields inherited from interface de.linusdev.data.AbstractData
PARSER -
Method Summary
Methods inherited from interface de.linusdev.data.AbstractData
addIfNotNull, addIfOptionalExists, addOrReplace, convertAndProcessIfContained, convertAndProcessIfContainedAndRequireNotNull, convertAndProcessListIfContained, convertWithExceptionAndProcessIfContained, convertWithExceptionAndProcessIfContainedAndRequireNotNull, convertWithExceptionAndProcessListIfContained, get, get, get, getAndConvert, getAndConvert, getAndConvertOrDefault, getAndConvertOrDefaultBoth, getAndConvertWithException, getAndConvertWithException, getAndRequireNotNull, getAndRequireNotNullAndConvert, getAndRequireNotNullAndConvertWithException, getAs, getAs, getAs, getAsAndRequireNotNull, getContainer, getData, getList, getList, getListAndConvert, getListAndConvertAndFreeMemory, getListAndConvertWithException, getListAndConvertWithExceptionAndFreeMemory, getNumberAsByte, getNumberAsDouble, getNumberAsFloat, getNumberAsInt, getNumberAsLong, getNumberAsShort, getOptionalValue, getOptionalValueAndConvert, getOptionalValueAndConvertWithException, getOrDefault, getOrDefault, getOrDefaultBoth, processIfContained, processIfContainedAndRequireNotNull, processIfNotNull, processListIfContained, toJsonString, toRecordMethods inherited from interface de.linusdev.data.ContentOnlyData
getParseTypeMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getKey
K getKey()- Returns:
- the key of the entry inside this
DataWrapper
-
getEntry
-
set
-
get
-
add
Description copied from interface:AbstractDataAdds a newEntry.
This method might not check, if a
Entrywith given key already exits. Depending on the implementation, this might even override existing mappings (for ExampleSODataMapImpl).- Specified by:
addin interfaceAbstractData<K,V> - Parameters:
key- keyvalue- value- Returns:
trueif a newEntrywas added,falseotherwise
-
addEntry
Description copied from interface:AbstractDataAdds a newEntry.
This method might not check, if a
Entrywith given key already exits (depending on the implementation)- Specified by:
addEntryin interfaceAbstractData<K,V> - Parameters:
entry- entry to add
-
remove
Description copied from interface:AbstractDataRemoves
Entrywith given key. If no such entry exists nothing happens.- Specified by:
removein interfaceAbstractData<K,V> - Parameters:
key- key for the entry to remove- Returns:
- the removed
Entryornullif no entry was removed.
-
isEmpty
default boolean isEmpty()- Specified by:
isEmptyin interfaceAbstractData<K,V> - Returns:
trueif this data does not contain any entries,falseotherwise
-
size
default int size()- Specified by:
sizein interfaceAbstractData<K,V> - Returns:
- current amount of
entriescontained.
-
iterator
-