Package com.mojang.serialization
Class JsonOps
java.lang.Object
com.mojang.serialization.JsonOps
- All Implemented Interfaces:
DynamicOps<JsonElement>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether this codec should compress bounded maps.<U> U
convertTo
(DynamicOps<U> outOps, JsonElement input) createBoolean
(boolean value) createList
(Stream<JsonElement> input) createMap
(Stream<Pair<JsonElement, JsonElement>> map) createString
(String value) empty()
getBooleanValue
(JsonElement input) getList
(JsonElement input) getMap
(JsonElement input) getMapEntries
(JsonElement input) getMapValues
(JsonElement input) getNumberValue
(JsonElement input) getStream
(JsonElement input) getStringValue
(JsonElement input) mergeToList
(JsonElement list, JsonElement value) mergeToList
(JsonElement list, List<JsonElement> values) mergeToMap
(JsonElement map, JsonElement key, JsonElement value) mergeToMap
(JsonElement map, MapLike<JsonElement> values) remove
(JsonElement input, String key) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.mojang.serialization.DynamicOps
convertList, convertMap, createByte, createByteList, createDouble, createFloat, createInt, createIntList, createLong, createLongList, createMap, createShort, emptyList, emptyMap, get, getByteBuffer, getGeneric, getIntStream, getLongStream, getNumberValue, mergeToMap, mergeToPrimitive, set, update, updateGeneric, withDecoder, withEncoder, withParser
-
Field Details
-
INSTANCE
-
COMPRESSED
-
-
Constructor Details
-
JsonOps
protected JsonOps(boolean compressed)
-
-
Method Details
-
empty
- Specified by:
empty
in interfaceDynamicOps<JsonElement>
-
convertTo
- Specified by:
convertTo
in interfaceDynamicOps<JsonElement>
-
getNumberValue
- Specified by:
getNumberValue
in interfaceDynamicOps<JsonElement>
-
createNumeric
- Specified by:
createNumeric
in interfaceDynamicOps<JsonElement>
-
getBooleanValue
- Specified by:
getBooleanValue
in interfaceDynamicOps<JsonElement>
-
createBoolean
- Specified by:
createBoolean
in interfaceDynamicOps<JsonElement>
-
getStringValue
- Specified by:
getStringValue
in interfaceDynamicOps<JsonElement>
-
createString
- Specified by:
createString
in interfaceDynamicOps<JsonElement>
-
mergeToList
- Specified by:
mergeToList
in interfaceDynamicOps<JsonElement>
-
mergeToList
- Specified by:
mergeToList
in interfaceDynamicOps<JsonElement>
-
mergeToMap
- Specified by:
mergeToMap
in interfaceDynamicOps<JsonElement>
-
mergeToMap
- Specified by:
mergeToMap
in interfaceDynamicOps<JsonElement>
-
getMapValues
- Specified by:
getMapValues
in interfaceDynamicOps<JsonElement>
-
getMapEntries
- Specified by:
getMapEntries
in interfaceDynamicOps<JsonElement>
-
getMap
- Specified by:
getMap
in interfaceDynamicOps<JsonElement>
-
createMap
- Specified by:
createMap
in interfaceDynamicOps<JsonElement>
-
getStream
- Specified by:
getStream
in interfaceDynamicOps<JsonElement>
-
getList
- Specified by:
getList
in interfaceDynamicOps<JsonElement>
-
createList
- Specified by:
createList
in interfaceDynamicOps<JsonElement>
-
remove
- Specified by:
remove
in interfaceDynamicOps<JsonElement>
-
toString
-
listBuilder
- Specified by:
listBuilder
in interfaceDynamicOps<JsonElement>
-
compressMaps
public boolean compressMaps()Description copied from interface:DynamicOps
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)
.- Specified by:
compressMaps
in interfaceDynamicOps<JsonElement>
- Returns:
- whether this codec should compress bounded maps
-
mapBuilder
- Specified by:
mapBuilder
in interfaceDynamicOps<JsonElement>
-