Interface SAOData<O>
- All Known Subinterfaces:
SAODataWrapper<O>,SOData,SODataWrapper
- All Known Implementing Classes:
SAOContentOnlyDataListImpl,SAODataListImpl,SAODataMapImpl,SAODataWrapperImpl,SODataListImpl,SODataMapImpl,SODataWrapperImpl
-
Field Summary
Fields inherited from interface de.linusdev.data.AbstractData
PARSER -
Method Summary
Modifier and TypeMethodDescriptionAdds a newEntry.static <O> @NotNull SAOData<O> newHashMapData(int initialCapacity) static <O> @NotNull SAOData<O> newOrderedDataWithKnownSize(int initialCapacity) This will create a newSAODatawhich will keep the order the elements are added.static <O> @NotNull SAOData<O> This will create a newSAODatawhich will keep the order the elements are added.static <V> @NotNull SAOData<V> Create aSAODataof givenmap.Methods inherited from interface de.linusdev.data.AbstractData
addAndGet, addEntry, addIfNotNull, addIfOptionalExists, addOrReplace, clear, computeIfAbsent, computeIfAbsentOrNull, convertAndProcessIfContained, convertAndProcessIfContainedAndRequireNotNull, convertAndProcessListIfContained, convertWithExceptionAndProcessIfContained, convertWithExceptionAndProcessIfContainedAndRequireNotNull, convertWithExceptionAndProcessListIfContained, get, get, get, getAndConvert, getAndConvert, getAndConvertOrDefault, getAndConvertOrDefaultBoth, getAndConvertWithException, getAndConvertWithException, getAndRequireNotNull, getAndRequireNotNullAndConvert, getAndRequireNotNullAndConvertWithException, getAs, getAs, getAs, getAsAndRequireNotNull, getContainer, getData, 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 <O> @NotNull SAOData<O> newOrderedDataWithKnownSize(int initialCapacity) This will create a new
SAODatawhich will keep the order the elements are added. ThisSAODatawill 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 returnedSAODatawill be in O(n), but theadd(String, Object)methods will be in O(1). -
newOrderedDataWithUnknownSize
This will create a new
SAODatawhich 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 returnedSAODatawill be in O(n), but theadd(String, Object)andAbstractData.remove(Object)methods will be in O(1).- Returns:
SAODatabacked by aLinkedList- See Also:
-
newHashMapData
-
ofMap
-
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<String,O> - Parameters:
key- keyvalue- value- Returns:
- this
-