- All Superinterfaces:
AbstractData<String,,Object> Datable,Iterable<Entry<String,,Object>> SAOData<Object>,SAODatable,SODatable
- All Known Subinterfaces:
SODataWrapper
- All Known Implementing Classes:
SODataListImpl,SODataMapImpl,SODataWrapperImpl
AbstractData, but the keys are strings and the values are objects.
SOData can be parsed to a json and json can be parsed to SOData using JsonParser.
See JsonParser for restrictions.
There are different
SOData implementations:
The static methods of this interface should be used to create new
SOData instances:
-
Field Summary
Fields inherited from interface de.linusdev.data.AbstractData
PARSER -
Method Summary
Modifier and TypeMethodDescriptiondefault SODatagetData()static @NotNull SODatanewHashMapData(int initialCapacity) static @NotNull SODatanewOrderedDataWithKnownSize(int initialCapacity) This will create a newSODatawhich will keep the order the elements are added.static @NotNull SODataThis will create a newSODatawhich will keep the order the elements are added.static @NotNull SODataWrapperMethods inherited from interface de.linusdev.data.AbstractData
add, addEntry, 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, getEntry, getList, getList, getListAndConvert, getListAndConvertAndFreeMemory, getListAndConvertWithException, getListAndConvertWithExceptionAndFreeMemory, getNumberAsByte, getNumberAsDouble, getNumberAsFloat, getNumberAsInt, getNumberAsLong, getNumberAsShort, getOptionalValue, getOptionalValueAndConvert, getOptionalValueAndConvertWithException, getOrDefault, getOrDefault, getOrDefaultBoth, getParseType, isEmpty, processIfContained, processIfContainedAndRequireNotNull, processIfNotNull, processListIfContained, remove, size, toJsonString, toRecordMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
newOrderedDataWithKnownSize
@Contract(pure=true) @NotNull static @NotNull SOData newOrderedDataWithKnownSize(int initialCapacity) This will create a new
SODatawhich will keep the order the elements are added. ThisSODatawill be backed by aArrayListwith given initialCapacity.
This is useful fordata objectswith known sizes or fordata objectswith small sizes.The
AbstractData.get(Object)andAbstractData.remove(Object)methods of the returnedSODatawill be in O(n), but theAbstractData.add(Object, Object)methods will be in O(1). -
newOrderedDataWithUnknownSize
This will create a new
SODatawhich will keep the order the elements are added. ThisSODataListImplwill be backed by a backed by aLinkedList.
This is useful fordata objectswith Unknown sizes.The
AbstractData.get(Object)methods of the returnedSODatawill be in O(n), but theAbstractData.add(Object, Object)andAbstractData.remove(Object)methods will be in O(1).- Returns:
SODatabacked by aLinkedList- See Also:
-
newHashMapData
-
wrap
- Parameters:
object- object to wrap- Returns:
SODataWrapperwrapping given object- See Also:
-
getData
- Specified by:
getDatain interfaceAbstractData<String,Object> - Specified by:
getDatain interfaceDatable- Specified by:
getDatain interfaceSAODatable- Specified by:
getDatain interfaceSODatable
-