Package com.mojang.serialization
Interface DynamicOps<T>
- All Known Implementing Classes:
JsonOps
public interface DynamicOps<T>
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Returns whether this codec should compress bounded maps.default <U> U
convertList
(DynamicOps<U> outOps, T input) default <U> U
convertMap
(DynamicOps<U> outOps, T input) <U> U
convertTo
(DynamicOps<U> outOps, T input) default T
createBoolean
(boolean value) default T
createByte
(byte value) default T
createByteList
(ByteBuffer input) default T
createDouble
(double value) default T
createFloat
(float value) default T
createInt
(int value) default T
createIntList
(IntStream input) createList
(Stream<T> input) default T
createLong
(long value) default T
createLongList
(LongStream input) default T
default T
createShort
(short value) createString
(String value) empty()
default T
default T
emptyMap()
default DataResult<T>
default DataResult<Boolean>
getBooleanValue
(T input) default DataResult<ByteBuffer>
getByteBuffer
(T input) default DataResult<T>
getGeneric
(T input, T key) default DataResult<IntStream>
getIntStream
(T input) default DataResult<Consumer<Consumer<T>>>
default DataResult<LongStream>
getLongStream
(T input) default DataResult<MapLike<T>>
default DataResult<Consumer<BiConsumer<T,
T>>> getMapEntries
(T input) DataResult<Stream<Pair<T,
T>>> getMapValues
(T input) getNumberValue
(T input) default Number
getNumberValue
(T input, Number defaultValue) getStringValue
(T input) default ListBuilder<T>
default RecordBuilder<T>
default DataResult<T>
mergeToList
(T list, List<T> values) mergeToList
(T list, T value) default DataResult<T>
mergeToMap
(T map, MapLike<T> values) default DataResult<T>
mergeToMap
(T map, Map<T, T> values) mergeToMap
(T map, T key, T value) default DataResult<T>
mergeToPrimitive
(T prefix, T value) default T
default T
default T
default <E> Function<T,
DataResult<Pair<E, T>>> withDecoder
(Decoder<E> decoder) default <E> Function<E,
DataResult<T>> withEncoder
(Encoder<E> encoder) default <E> Function<T,
DataResult<E>> withParser
(Decoder<E> decoder)
-
Method Details
-
empty
T empty() -
emptyMap
-
emptyList
-
convertTo
-
getNumberValue
-
getNumberValue
-
createNumeric
-
createByte
-
createShort
-
createInt
-
createLong
-
createFloat
-
createDouble
-
getBooleanValue
-
createBoolean
-
getStringValue
-
createString
-
mergeToList
- Mojang-Added Docs:
Only successful if first argument is a list/array or empty
-
mergeToList
-
mergeToMap
- Mojang-Added Docs:
Only successful if first argument is a map or empty
-
mergeToMap
-
mergeToMap
-
mergeToPrimitive
- Mojang-Added Docs:
Only successful if first argument is empty
-
getMapValues
-
getMapEntries
-
createMap
-
getMap
-
createMap
-
getStream
-
getList
-
createList
-
getByteBuffer
-
createByteList
-
getIntStream
-
createIntList
-
getLongStream
-
createLongList
-
remove
-
compressMaps
default boolean compressMaps()Returns whether this codec should compress bounded maps. A codec that compresses bounded maps will encode a bounded map, as produced by aMapCodec
, as a list of values only. The indices of the values in the list are the indices of the original keys inMapCodec.keys(DynamicOps)
.- Returns:
- whether this codec should compress bounded maps
-
get
-
getGeneric
-
set
-
update
-
updateGeneric
-
listBuilder
-
mapBuilder
-
withEncoder
-
withDecoder
-
withParser
-
convertList
-
convertMap
-