Package com.mojang.serialization
Class DynamicLike<T>
java.lang.Object
com.mojang.serialization.DynamicLike<T>
- Direct Known Subclasses:
Dynamic
,OptionalDynamic
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
asBoolean
(boolean defaultValue) byte
asByte
(byte defaultValue) abstract DataResult<ByteBuffer>
double
asDouble
(double defaultValue) float
asFloat
(float defaultValue) int
asInt
(int defaultValue) abstract DataResult<IntStream>
<U> List<U>
<U> DataResult<List<U>>
long
asLong
(long defaultValue) abstract DataResult<LongStream>
<K,
V> Map<K, V> asMapOpt()
<K,
V> DataResult<Map<K, V>> abstract DataResult<Number>
asNumber()
short
asShort
(short defaultValue) asStream()
abstract DataResult<Stream<Dynamic<T>>>
abstract DataResult<String>
asString()
createBoolean
(boolean value) createByte
(byte value) Dynamic<?>
createByteList
(ByteBuffer input) createDouble
(double value) createFloat
(float value) createInt
(int value) Dynamic<?>
createIntList
(IntStream input) createList
(Stream<? extends Dynamic<?>> input) createLong
(long value) Dynamic<?>
createLongList
(LongStream input) createShort
(short value) createString
(String value) abstract <A> DataResult<Pair<A,
T>> emptyMap()
abstract OptionalDynamic<T>
abstract DataResult<T>
getElement
(String key) getElement
(String key, T defaultValue) abstract DataResult<T>
getElementGeneric
(T key) getElementGeneric
(T key, T defaultValue) abstract DataResult<T>
getGeneric
(T key) getOps()
<A> DataResult<A>
<E> DataResult<List<E>>
<E> DataResult<List<E>>
readList
(Function<? super Dynamic<?>, ? extends DataResult<? extends E>> decoder) <R> DataResult<R>
readMap
(DataResult<R> empty, Function3<R, Dynamic<T>, Dynamic<T>, DataResult<R>> combiner) <K,
V> DataResult<List<Pair<K, V>>> <K,
V> DataResult<List<Pair<K, V>>>
-
Field Details
-
ops
-
-
Constructor Details
-
DynamicLike
-
-
Method Details
-
getOps
-
asNumber
-
asString
-
asStreamOpt
-
asMapOpt
-
asByteBufferOpt
-
asIntStreamOpt
-
asLongStreamOpt
-
get
-
getGeneric
-
getElement
-
getElementGeneric
-
decode
-
asListOpt
-
asMapOpt
-
read
-
readList
-
readList
public <E> DataResult<List<E>> readList(Function<? super Dynamic<?>, ? extends DataResult<? extends E>> decoder) -
readMap
-
readMap
-
readMap
public <R> DataResult<R> readMap(DataResult<R> empty, Function3<R, Dynamic<T>, Dynamic<T>, DataResult<R>> combiner) -
asNumber
-
asInt
public int asInt(int defaultValue) -
asLong
public long asLong(long defaultValue) -
asFloat
public float asFloat(float defaultValue) -
asDouble
public double asDouble(double defaultValue) -
asByte
public byte asByte(byte defaultValue) -
asShort
public short asShort(short defaultValue) -
asBoolean
public boolean asBoolean(boolean defaultValue) -
asString
-
asStream
-
asByteBuffer
-
asIntStream
-
asLongStream
-
asList
-
asMap
-
getElement
-
getElementGeneric
-
emptyList
-
emptyMap
-
createNumeric
-
createByte
-
createShort
-
createInt
-
createLong
-
createFloat
-
createDouble
-
createBoolean
-
createString
-
createList
-
createMap
-
createByteList
-
createIntList
-
createLongList
-