Class AssetBuilderCodec<K,T extends JsonAsset<K>>
java.lang.Object
com.hypixel.hytale.codec.builder.BuilderCodec<T>
com.hypixel.hytale.assetstore.codec.AssetBuilderCodec<K,T>
- All Implemented Interfaces:
AssetCodec<K,,T> Codec<T>,DirectDecodeCodec<T>,InheritCodec<T>,RawJsonCodec<T>,RawJsonInheritCodec<T>,SchemaConvertable<T>,ValidatableCodec<T>
public class AssetBuilderCodec<K,T extends JsonAsset<K>>
extends BuilderCodec<T>
implements AssetCodec<K,T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAssetBuilderCodec.Builder<K,T extends JsonAsset<K>> Nested classes/interfaces inherited from class com.hypixel.hytale.codec.builder.BuilderCodec
BuilderCodec.BuilderBase<T,S extends BuilderCodec.BuilderBase<T, S>>, BuilderCodec.EntryType, BuilderCodec.KeyEntry<T> -
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> private static final Stringstatic final KeyedCodec<Map<String, String[]>> Fields inherited from class com.hypixel.hytale.codec.builder.BuilderCodec
afterDecode, codecVersion, documentation, EMPTY_ARRAY, entries, hasNonNullValidator, INITIAL_VERSION, metadata, minCodecVersion, stringTreeMap, supplier, tClass, unmodifiableEntries, UNSET_MAX_VERSION, UNSET_VERSION, useLegacyVersion, validator, versionedFields 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
ConstructorsModifierConstructorDescriptionprotectedAssetBuilderCodec(AssetBuilderCodec.Builder<K, T> builder) -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,T extends JsonAsset<K>>
AssetBuilderCodec.Builder<K, T> builder(Class<T> tClass, Supplier<T> supplier, BuilderCodec<? super T> parentCodec, Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, Function<T, AssetExtraInfo.Data> dataGetter) static <K,T extends JsonAsset<K>>
AssetBuilderCodec.Builder<K, T> builder(Class<T> tClass, Supplier<T> supplier, Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, Function<T, AssetExtraInfo.Data> dataGetter) decodeAndInheritJsonAsset(RawJsonReader reader, T parent, AssetExtraInfo<K> extraInfo) decodeJsonAsset(RawJsonReader reader, AssetExtraInfo<K> extraInfo) toSchema(SchemaContext context) toSchema(SchemaContext context, T def) static <K,T extends JsonAsset<K>>
AssetBuilderCodec<K, T> wrap(BuilderCodec<T> codec, Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, Function<T, AssetExtraInfo.Data> dataGetter) Methods inherited from class com.hypixel.hytale.codec.builder.BuilderCodec
abstractBuilder, abstractBuilder, afterDecode, afterDecodeAndValidate, builder, builder, decode, decode, decode0, decodeAndInherit, decodeAndInherit, decodeAndInherit0, decodeAndInheritJson, decodeAndInheritJson, decodeAndInheritJson0, decodeJson, decodeJson, decodeJson0, decodeVersion, decodeVersion, encode, encode0, findEntry, findField, getAfterDecode, getCodecVersion, getDefaultValue, getDefaultValue, getDocumentation, getEntries, getInnerClass, getParent, getSupplier, inherit, readAndInheritEntry, readEntry, toString, validate, validateDefaultsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.hypixel.hytale.codec.Codec
decode, decode, decodeJson, encode, encodeMethods inherited from interface com.hypixel.hytale.codec.InheritCodec
decodeAndInherit, decodeAndInheritMethods inherited from interface com.hypixel.hytale.codec.RawJsonCodec
decodeJsonMethods inherited from interface com.hypixel.hytale.codec.RawJsonInheritCodec
decodeAndInheritJson, decodeAndInheritJsonMethods inherited from interface com.hypixel.hytale.codec.validation.ValidatableCodec
validate, validateDefaults
-
Field Details
-
TAGS_CODEC
-
TAG_DOCUMENTATION
- See Also:
-
idCodec
-
parentCodec
-
idSetter
-
dataSetter
-
dataGetter
-
-
Constructor Details
-
AssetBuilderCodec
-
-
Method Details
-
getKeyCodec
- Specified by:
getKeyCodecin interfaceAssetCodec<K,T extends JsonAsset<K>>
-
getParentCodec
- Specified by:
getParentCodecin interfaceAssetCodec<K,T extends JsonAsset<K>>
-
getData
-
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 classBuilderCodec<T extends JsonAsset<K>>
-
toSchema
- Specified by:
toSchemain interfaceSchemaConvertable<K>- Overrides:
toSchemain classBuilderCodec<T extends JsonAsset<K>>
-
builder
@Nonnull public static <K,T extends JsonAsset<K>> AssetBuilderCodec.Builder<K,T> builder(Class<T> tClass, Supplier<T> supplier, Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, @Nonnull Function<T, AssetExtraInfo.Data> dataGetter) -
builder
@Nonnull public static <K,T extends JsonAsset<K>> AssetBuilderCodec.Builder<K,T> builder(Class<T> tClass, Supplier<T> supplier, BuilderCodec<? super T> parentCodec, Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, @Nonnull Function<T, AssetExtraInfo.Data> dataGetter) -
wrap
@Nonnull public static <K,T extends JsonAsset<K>> AssetBuilderCodec<K,T> wrap(@Nonnull BuilderCodec<T> codec, Codec<K> idCodec, BiConsumer<T, K> idSetter, Function<T, K> idGetter, BiConsumer<T, AssetExtraInfo.Data> dataSetter, @Nonnull Function<T, AssetExtraInfo.Data> dataGetter)
-