Contents
- Description
- Nested Class Summary
- Field Summary
- Method Summary
- Field Details
- Method Details
- getInnerClass()
- getSupplier()
- getDefaultValue()
- getDefaultValue(ExtraInfo)
- getEntries()
- getAfterDecode()
- getParent()
- getDocumentation()
- getCodecVersion()
- inherit(T, T, ExtraInfo)
- afterDecode(T, ExtraInfo)
- afterDecodeAndValidate(T, ExtraInfo)
- decode(BsonValue, ExtraInfo)
- encode(T, ExtraInfo)
- decode(BsonValue, T, ExtraInfo)
- decodeJson(RawJsonReader, ExtraInfo)
- decodeJson(RawJsonReader, T, ExtraInfo)
- decodeAndInherit(BsonDocument, T, ExtraInfo)
- decodeAndInherit(BsonDocument, T, T, ExtraInfo)
- decodeAndInheritJson(RawJsonReader, T, ExtraInfo)
- decodeAndInheritJson(RawJsonReader, T, T, ExtraInfo)
- decodeAndInheritJson0(RawJsonReader, T, T, ExtraInfo)
- validate(T, ExtraInfo)
- validateDefaults(ExtraInfo, Set)
- toSchema(SchemaContext)
- toSchema(SchemaContext, T)
- toString()
- builder(Class, Supplier)
- builder(Class, Supplier, BuilderCodec)
- abstractBuilder(Class)
- abstractBuilder(Class, BuilderCodec)
Class BuilderCodec<T>
java.lang.Object
com.hypixel.hytale.codec.builder.BuilderCodec<T>
- All Implemented Interfaces:
Codec<T>, DirectDecodeCodec<T>, InheritCodec<T>, RawJsonCodec<T>, RawJsonInheritCodec<T>, SchemaConvertable<T>, ValidatableCodec<T>
- Direct Known Subclasses:
AssetBuilderCodec, HytaleWorldGenProvider.WorldGenBuilderCodec
public class BuilderCodec<T>
extends Object
implements Codec<T>, DirectDecodeCodec<T>, RawJsonCodec<T>, InheritCodec<T>, ValidatableCodec<T>
- Since:
- 18/8/17.
- Version:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classBuilderCodec.BuilderBase<T, S extends BuilderCodec.BuilderBase<T,S>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<?>[]static final intstatic final intstatic final intFields 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 <T> BuilderCodec.Builder<T> abstractBuilder(Class<T> tClass) static <T> BuilderCodec.Builder<T> abstractBuilder(Class<T> tClass, BuilderCodec<? super T> parentCodec) voidafterDecode(T t, ExtraInfo extraInfo) voidafterDecodeAndValidate(T t, ExtraInfo extraInfo) static <T> BuilderCodec.Builder<T> static <T> BuilderCodec.Builder<T> builder(Class<T> tClass, Supplier<T> supplier, BuilderCodec<? super T> parentCodec) voiddecodeAndInherit(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) voiddecodeAndInheritJson0(RawJsonReader reader, T t, T parent, ExtraInfo extraInfo) decodeJson(RawJsonReader reader, ExtraInfo extraInfo) voiddecodeJson(RawJsonReader reader, T t, ExtraInfo extraInfo) org.bson.BsonDocumentintReturns the highest version number used on a field for either theBuilderField.getMinVersion()orBuilderField.getMaxVersion().getDefaultValue(ExtraInfo extraInfo) Map<String, List<BuilderField<T, ?>>> BuilderCodec<? super T> voidtoSchema(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.toString()voidvoidvalidateDefaults(ExtraInfo extraInfo, Set<Codec<?>> tested) Methods inherited from interface RawJsonCodec
decodeJson
-
Field Details
-
UNSET_VERSION
public static final int UNSET_VERSION- See Also:
-
UNSET_MAX_VERSION
public static final int UNSET_MAX_VERSION- See Also:
-
INITIAL_VERSION
public static final int INITIAL_VERSION- See Also:
-
EMPTY_ARRAY
-
-
Method Details
-
getInnerClass
-
getSupplier
-
getDefaultValue
-
getDefaultValue
-
getEntries
-
getAfterDecode
-
getParent
-
getDocumentation
-
getCodecVersion
public int getCodecVersion()Returns the highest version number used on a field for either theBuilderField.getMinVersion()orBuilderField.getMaxVersion().- Returns:
- the highest version number or
Integer.MIN_VALUEif no field has a version
-
inherit
-
afterDecode
-
afterDecodeAndValidate
-
decode
-
encode
-
decode
- Specified by:
decodein interfaceDirectDecodeCodec<T>
-
decodeJson
- Specified by:
decodeJsonin interfaceCodec<T>- Specified by:
decodeJsonin interfaceRawJsonCodec<T>- Throws:
IOException
-
decodeJson
public void decodeJson(@Nonnull RawJsonReader reader, T t, @Nonnull ExtraInfo extraInfo) throws IOException - Throws:
IOException
-
decodeAndInherit
- Specified by:
decodeAndInheritin interfaceInheritCodec<T>
-
decodeAndInherit
public void decodeAndInherit(@Nonnull org.bson.BsonDocument document, T t, @Nullable T parent, ExtraInfo extraInfo) - Specified by:
decodeAndInheritin interfaceInheritCodec<T>
-
decodeAndInheritJson
public T decodeAndInheritJson(@Nonnull RawJsonReader reader, T parent, ExtraInfo extraInfo) throws IOException - Specified by:
decodeAndInheritJsonin interfaceRawJsonInheritCodec<T>- Throws:
IOException
-
decodeAndInheritJson
public void decodeAndInheritJson(@Nonnull RawJsonReader reader, T t, @Nullable T parent, ExtraInfo extraInfo) throws IOException - Specified by:
decodeAndInheritJsonin interfaceRawJsonInheritCodec<T>- Throws:
IOException
-
decodeAndInheritJson0
public void decodeAndInheritJson0(@Nonnull RawJsonReader reader, T t, T parent, @Nonnull ExtraInfo extraInfo) throws IOException - Throws:
IOException
-
validate
- Specified by:
validatein interfaceValidatableCodec<T>
-
validateDefaults
- Specified by:
validateDefaultsin interfaceValidatableCodec<T>
-
toSchema
Description copied from interface:SchemaConvertableReturns a schema object that represents this codec as JSON Schema.- Specified by:
toSchemain interfaceSchemaConvertable<T>- 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<T>- 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.
-
toString
-
builder
-
builder
@Nonnull public static <T> BuilderCodec.Builder<T> builder(Class<T> tClass, Supplier<T> supplier, BuilderCodec<? super T> parentCodec) -
abstractBuilder
-
abstractBuilder
@Nonnull public static <T> BuilderCodec.Builder<T> abstractBuilder(Class<T> tClass, BuilderCodec<? super T> parentCodec)
-