Contents
- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Constructor Details
- AssetCodecMapCodec(Codec, BiConsumer, Function, BiConsumer, Function)
- AssetCodecMapCodec(String, Codec, BiConsumer, Function, BiConsumer, Function)
- AssetCodecMapCodec(Codec, BiConsumer, Function, BiConsumer, Function, boolean)
- AssetCodecMapCodec(String, Codec, BiConsumer, Function, BiConsumer, Function, boolean)
- Method Details
- getKeyCodec()
- getParentCodec()
- getData(T)
- register(String, Class, BuilderCodec)
- register(Priority, String, Class, BuilderCodec)
- decodeAndInherit(BsonDocument, T, ExtraInfo)
- decodeAndInherit(BsonDocument, T, T, ExtraInfo)
- decodeAndInheritJson(RawJsonReader, T, ExtraInfo)
- decodeAndInheritJson(RawJsonReader, T, T, ExtraInfo)
- decodeJsonAsset(RawJsonReader, AssetExtraInfo)
- decodeAndInheritJsonAsset(RawJsonReader, T, AssetExtraInfo)
- toSchema(SchemaContext)
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 ACodecMapCodec
ACodecMapCodec.UnknownIdException -
Field Summary
Fields inherited from interface 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, NULLABLE_BOOLEAN, 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) toSchema(SchemaContext context) Returns a schema object that represents this codec as JSON Schema.Methods inherited from class StringCodecMapCodec
decodeJson, register, removeMethods inherited from class ACodecMapCodec
decode, encode, getClassFor, getCodecFor, getCodecFor, getDefaultCodec, getIdFor, getKey, getRegisteredIds, register, validate, validateDefaultsMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RawJsonCodec
decodeJsonMethods inherited from interface SchemaConvertable
toSchemaMethods inherited from interface ValidatableCodec
validate, validateDefaults
-
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
Description copied from interface:SchemaConvertableReturns a schema object that represents this codec as JSON Schema.- Specified by:
toSchemain interfaceSchemaConvertable<K>- Overrides:
toSchemain classACodecMapCodec<String, T extends JsonAsset<K>, AssetBuilderCodec<K, T extends JsonAsset<K>>>- Parameters:
context- A context to use to assist with creating the schema.- Returns:
- the generated schema.
-