Contents
- Description
- Nested Class Summary
- Field Summary
- Method Summary
- Field Details
- Method Details
- getKeyCodec()
- getParentCodec()
- getData(T)
- decodeJsonAsset(RawJsonReader, AssetExtraInfo)
- decodeAndInheritJsonAsset(RawJsonReader, T, AssetExtraInfo)
- toSchema(SchemaContext)
- toSchema(SchemaContext, T)
- builder(Class, Supplier, Codec, BiConsumer, Function, BiConsumer, Function)
- builder(Class, Supplier, BuilderCodec, Codec, BiConsumer, Function, BiConsumer, Function)
- wrap(BuilderCodec, Codec, BiConsumer, Function, BiConsumer, Function)
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>
- Since:
- 29/8/17.
- Version:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAssetBuilderCodec.Builder<K, T extends JsonAsset<K>>Nested classes/interfaces inherited from class BuilderCodec
BuilderCodec.BuilderBase<T,S> -
Field Summary
FieldsFields inherited from class BuilderCodec
EMPTY_ARRAY, INITIAL_VERSION, UNSET_MAX_VERSION, UNSET_VERSIONFields 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 -
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) Returns a schema object that represents this codec as JSON Schema.toSchema(SchemaContext context, T def) Returns a schema object that represents this codec as JSON Schema.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 BuilderCodec
abstractBuilder, abstractBuilder, afterDecode, afterDecodeAndValidate, builder, builder, decode, decode, decodeAndInherit, decodeAndInherit, decodeAndInheritJson, decodeAndInheritJson, decodeAndInheritJson0, decodeJson, decodeJson, encode, getAfterDecode, getCodecVersion, getDefaultValue, getDefaultValue, getDocumentation, getEntries, getInnerClass, getParent, getSupplier, inherit, toString, validate, validateDefaultsMethods inherited from interface InheritCodec
decodeAndInherit, decodeAndInheritMethods inherited from interface RawJsonCodec
decodeJsonMethods inherited from interface RawJsonInheritCodec
decodeAndInheritJson, decodeAndInheritJsonMethods inherited from interface ValidatableCodec
validate, validateDefaults
-
Field Details
-
TAGS_CODEC
-
-
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
Description copied from interface:SchemaConvertableReturns a schema object that represents this codec as JSON Schema.- Specified by:
toSchemain interfaceSchemaConvertable<K>- Overrides:
toSchemain classBuilderCodec<T extends JsonAsset<K>>- Parameters:
context- A context to use to assist with creating the schema.- Returns:
- the generated schema.
-
toSchema
Description copied from interface:SchemaConvertableReturns a schema object that represents this codec as JSON Schema.- Specified by:
toSchemain interfaceSchemaConvertable<K>- Overrides:
toSchemain classBuilderCodec<T extends JsonAsset<K>>- Parameters:
context- A context to use to assist with creating the schema.def- An instance of what this codec can produce which is the default value.- Returns:
- the generated schema.
-
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)
-