HyCodeYourTale
classpublicPriority 3

BuilderCodec

com.hypixel.hytale.codec.builder.BuilderCodec

implements Codec, DirectDecodeCodec, RawJsonCodec, InheritCodec, ValidatableCodec

43

Methods

43

Public Methods

22

Fields

1

Constructors

Constants

intINITIAL_VERSION= 0
intUNSET_MAX_VERSION= 2147483647
intUNSET_VERSION= -2147483648
KeyedCodec<Integer>VERSION= new KeyedCodec<>("Version", INTEGER)

Constructors

protected
BuilderCodec(BuilderCodec.BuilderBase<T, ?> builder)

Methods

Public Methods (43)

publicstatic
<T> BuilderCodec.Builder<T> abstractBuilder(Class<T> tClass)
@Nonnull
publicstatic
<T> BuilderCodec.Builder<T> abstractBuilder(Class<T> tClass, BuilderCodec<? super T> parentCodec)
@Nonnull
public
<FieldType> S addField(KeyedCodec<FieldType> codec, BiConsumer<T, FieldType> setter, Function<T, FieldType> getter)
@Nonnull@Deprecated
public
<FieldType> S addField(BuilderField<T, FieldType> entry)
@Nonnull
public
void afterDecode(T t, ExtraInfo extraInfo)
public
S afterDecode(Consumer<T> afterDecode)
@Nonnull
public
S afterDecode(BiConsumer<T, ExtraInfo> afterDecode)
@Nonnull
public
void afterDecodeAndValidate(T t, ExtraInfo extraInfo)
public
BuilderCodec<T> build()
@Nonnull
publicstatic
<T> BuilderCodec.Builder<T> builder(Class<T> tClass, Supplier<T> supplier)
@Nonnull
publicstatic
<T> BuilderCodec.Builder<T> builder(Class<T> tClass, Supplier<T> supplier, BuilderCodec<? super T> parentCodec)
@Nonnull
public
S codecVersion(int minCodecVersion, int codecVersion)
@Nonnull
public
S codecVersion(int codecVersion)
@Nonnull
public
T decode(BsonValue bsonValue, ExtraInfo extraInfo)
@Override
public
void decode(BsonValue bsonValue, T t, ExtraInfo extraInfo)
@Override
public
T decodeAndInherit(BsonDocument document, T parent, ExtraInfo extraInfo)
@Override
public
void decodeAndInherit(BsonDocument document, T t, T parent, ExtraInfo extraInfo)
@Override
public
T decodeAndInheritJson(RawJsonReader reader, T parent, ExtraInfo extraInfo)

throws IOException

@Override
public
void decodeAndInheritJson(RawJsonReader reader, T t, T parent, ExtraInfo extraInfo)

throws IOException

@Override
public
void decodeAndInheritJson0(RawJsonReader reader, T t, T parent, ExtraInfo extraInfo)

throws IOException

public
T decodeJson(RawJsonReader reader, ExtraInfo extraInfo)

throws IOException

@Override
public
void decodeJson(RawJsonReader reader, T t, ExtraInfo extraInfo)

throws IOException

public
void decodeJson0(RawJsonReader reader, T t, ExtraInfo extraInfo)

throws IOException

public
S documentation(String doc)
@Nonnull
public
BsonDocument encode(T t, ExtraInfo extraInfo)
@Nonnull
public
BiConsumer<T, ExtraInfo> getAfterDecode()
public
int getCodecVersion()
public
T getDefaultValue()
public
T getDefaultValue(ExtraInfo extraInfo)
public
String getDocumentation()
public
Class<T> getInnerClass()
public
Supplier<T> getSupplier()
public
BuilderCodec.EntryType getType()
public
void inherit(T t, T parent, ExtraInfo extraInfo)
public
S legacyVersioned()
@Nonnull@Deprecated
public
S metadata(Metadata metadata)
@Nonnull
public
ObjectSchema toSchema(SchemaContext context)
@Nonnull
public
ObjectSchema toSchema(SchemaContext context, T def)
@Nonnull
public
String toString()
@Nonnull@Override
public
void validate(T t, ExtraInfo extraInfo)
@Override
public
void validateDefaults(ExtraInfo extraInfo, Set<Codec<?>> tested)
@Override
public
S validator(BiConsumer<T, ValidationResults> validator)
@Nonnull@Deprecated
public
S versioned()
@Nonnull

Fields

Protected Fields (12)

protectedBiConsumer<T, ExtraInfo> afterDecode
protectedint codecVersion
protectedString documentation
protectedboolean hasNonNullValidator
protectedList<Metadata> metadata
protectedint minCodecVersion
protectedStringTreeMap<BuilderCodec.KeyEntry<T>> stringTreeMap
protectedSupplier<T> supplier
protectedClass<T> tClass
protectedboolean useLegacyVersion
protectedBiConsumer<T, ValidationResults> validator
protectedboolean versioned

Private/Package Fields (10)

package-privateKeyedCodec<FieldType> codec
package-privateObject defC
package-privateSchema finalSchema
package-privateint i
package-privateBuilderCodec.KeyEntry<T> keyEntry
package-privatereturn null
package-privatereturn null
package-privatereturn t
package-privatereturn t
package-privateint version

Related Classes