Class AssetCodecMapCodec<K,T extends JsonAsset<K>>
java.lang.Object
com.hypixel.hytale.codec.lookup.ACodecMapCodec<String,T,AssetBuilderCodec<K,T>>
com.hypixel.hytale.codec.lookup.StringCodecMapCodec<T,AssetBuilderCodec<K,T>>
com.hypixel.hytale.assetstore.codec.AssetCodecMapCodec<K,T>
- All Implemented Interfaces:
AssetCodec<K,,T> Codec<T>,InheritCodec<T>,RawJsonCodec<T>,RawJsonInheritCodec<T>,SchemaConvertable<T>,ValidatableCodec<T>
public class AssetCodecMapCodec<K,T extends JsonAsset<K>>
extends StringCodecMapCodec<T,AssetBuilderCodec<K,T>>
implements AssetCodec<K,T>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.hypixel.hytale.codec.lookup.ACodecMapCodec
ACodecMapCodec.UnknownIdException -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Function<T, AssetExtraInfo.Data> protected final BiConsumer<T, AssetExtraInfo.Data> protected final KeyedCodec<K> protected final BiConsumer<T, K> protected final KeyedCodec<K> Fields inherited from class com.hypixel.hytale.codec.lookup.StringCodecMapCodec
stampedLock, stringTreeMapFields inherited from class com.hypixel.hytale.codec.lookup.ACodecMapCodec
allowDefault, classToId, codecs, encodeDefaultKey, idToClass, idToCodec, key, keyCodecFields inherited from interface com.hypixel.hytale.codec.Codec
BASE64_PATTERN, BOOLEAN, BSON_DOCUMENT, BYTE, BYTE_ARRAY, DOUBLE, DOUBLE_ARRAY, DURATION, DURATION_SECONDS, FLOAT, FLOAT_ARRAY, INSTANT, INT_ARRAY, INTEGER, LOG_LEVEL, LONG, LONG_ARRAY, PATH, SHORT, STRING, STRING_ARRAY, UUID_BINARY, UUID_STRING -
Constructor Summary
ConstructorsConstructorDescriptionAssetCodecMapCodec(Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, Function<T, AssetExtraInfo.Data> dataGetter) AssetCodecMapCodec(Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, Function<T, AssetExtraInfo.Data> dataGetter, boolean allowDefault) AssetCodecMapCodec(String key, Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, Function<T, AssetExtraInfo.Data> dataGetter) AssetCodecMapCodec(String key, Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, Function<T, AssetExtraInfo.Data> dataGetter, boolean allowDefault) -
Method Summary
Modifier and TypeMethodDescriptiondecodeAndInherit(org.bson.BsonDocument document, T parent, ExtraInfo extraInfo) voiddecodeAndInherit(org.bson.BsonDocument document, T t, T parent, ExtraInfo extraInfo) decodeAndInheritJson(RawJsonReader reader, T parent, ExtraInfo extraInfo) voiddecodeAndInheritJson(RawJsonReader reader, T t, T parent, ExtraInfo extraInfo) decodeAndInheritJsonAsset(RawJsonReader reader, T parent, AssetExtraInfo<K> extraInfo) decodeJsonAsset(RawJsonReader reader, AssetExtraInfo<K> extraInfo) protected voidmutateChildSchema(String key, SchemaContext context, BuilderCodec<? extends T> c, ObjectSchema objectSchema) toSchema(SchemaContext context) Methods inherited from class com.hypixel.hytale.codec.lookup.StringCodecMapCodec
decodeJson, register, removeMethods inherited from class com.hypixel.hytale.codec.lookup.ACodecMapCodec
decode, encode, getClassFor, getCodecFor, getCodecFor, getDefaultCodec, getIdFor, getRegisteredIds, register, validate, validateDefaultsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hypixel.hytale.codec.Codec
decode, decode, decodeJson, encode, encodeMethods inherited from interface com.hypixel.hytale.codec.RawJsonCodec
decodeJsonMethods inherited from interface com.hypixel.hytale.codec.schema.SchemaConvertable
toSchemaMethods inherited from interface com.hypixel.hytale.codec.validation.ValidatableCodec
validate, validateDefaults
-
Field Details
-
idCodec
-
parentCodec
-
idSetter
-
idGetter
-
dataSetter
-
dataGetter
-
-
Constructor Details
-
AssetCodecMapCodec
public AssetCodecMapCodec(Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, Function<T, AssetExtraInfo.Data> dataGetter) -
AssetCodecMapCodec
public AssetCodecMapCodec(String key, Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, Function<T, AssetExtraInfo.Data> dataGetter) -
AssetCodecMapCodec
public AssetCodecMapCodec(Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, Function<T, AssetExtraInfo.Data> dataGetter, boolean allowDefault) -
AssetCodecMapCodec
public AssetCodecMapCodec(String key, Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, Function<T, AssetExtraInfo.Data> dataGetter, boolean allowDefault)
-
-
Method Details
-
getKeyCodec
- Specified by:
getKeyCodecin interfaceAssetCodec<K,T extends JsonAsset<K>>
-
getParentCodec
- Specified by:
getParentCodecin interfaceAssetCodec<K,T extends JsonAsset<K>>
-
getData
-
register
@Nonnull public AssetCodecMapCodec<K,T> register(@Nonnull String id, Class<? extends T> aClass, BuilderCodec<? extends T> codec) -
register
@Nonnull public AssetCodecMapCodec<K,T> register(@Nonnull Priority priority, @Nonnull String id, Class<? extends T> aClass, BuilderCodec<? extends T> codec) -
decodeAndInherit
- Specified by:
decodeAndInheritin interfaceInheritCodec<K>- Overrides:
decodeAndInheritin classACodecMapCodec<String,T extends JsonAsset<K>, AssetBuilderCodec<K, T extends JsonAsset<K>>>
-
decodeAndInherit
public void decodeAndInherit(@Nonnull org.bson.BsonDocument document, T t, T parent, ExtraInfo extraInfo) - Specified by:
decodeAndInheritin interfaceInheritCodec<K>- Overrides:
decodeAndInheritin classACodecMapCodec<String,T extends JsonAsset<K>, AssetBuilderCodec<K, T extends JsonAsset<K>>>
-
decodeAndInheritJson
public T decodeAndInheritJson(@Nonnull RawJsonReader reader, @Nullable T parent, @Nonnull ExtraInfo extraInfo) throws IOException - Specified by:
decodeAndInheritJsonin interfaceRawJsonInheritCodec<K>- Overrides:
decodeAndInheritJsonin classACodecMapCodec<String,T extends JsonAsset<K>, AssetBuilderCodec<K, T extends JsonAsset<K>>> - Throws:
IOException
-
decodeAndInheritJson
public void decodeAndInheritJson(@Nonnull RawJsonReader reader, T t, @Nullable T parent, @Nonnull ExtraInfo extraInfo) throws IOException - Specified by:
decodeAndInheritJsonin interfaceRawJsonInheritCodec<K>- Overrides:
decodeAndInheritJsonin classACodecMapCodec<String,T extends JsonAsset<K>, AssetBuilderCodec<K, T extends JsonAsset<K>>> - Throws:
IOException
-
decodeJsonAsset
public T decodeJsonAsset(@Nonnull RawJsonReader reader, @Nonnull AssetExtraInfo<K> extraInfo) throws IOException - Specified by:
decodeJsonAssetin interfaceAssetCodec<K,T extends JsonAsset<K>> - Throws:
IOException
-
decodeAndInheritJsonAsset
public T decodeAndInheritJsonAsset(@Nonnull RawJsonReader reader, @Nullable T parent, @Nonnull AssetExtraInfo<K> extraInfo) throws IOException - Specified by:
decodeAndInheritJsonAssetin interfaceAssetCodec<K,T extends JsonAsset<K>> - Throws:
IOException
-
toSchema
- Specified by:
toSchemain interfaceSchemaConvertable<K>- Overrides:
toSchemain classACodecMapCodec<String,T extends JsonAsset<K>, AssetBuilderCodec<K, T extends JsonAsset<K>>>
-
mutateChildSchema
protected void mutateChildSchema(String key, @Nonnull SchemaContext context, BuilderCodec<? extends T> c, @Nonnull ObjectSchema objectSchema) - Overrides:
mutateChildSchemain classACodecMapCodec<String,T extends JsonAsset<K>, AssetBuilderCodec<K, T extends JsonAsset<K>>>
-