Contents
- Description
- Method Summary
- Method Details
- documentation(String)
- versioned()
- legacyVersioned()
- addField(KeyedCodec, BiConsumer, Function)
- append(KeyedCodec, BiConsumer, Function)
- append(KeyedCodec, TriConsumer, BiFunction)
- appendInherited(KeyedCodec, BiConsumer, Function, BiConsumer)
- appendInherited(KeyedCodec, TriConsumer, BiFunction, TriConsumer)
- addField(BuilderField)
- afterDecode(Consumer)
- afterDecode(BiConsumer)
- validator(BiConsumer)
- metadata(Metadata)
- codecVersion(int, int)
- codecVersion(int)
- build()
Class BuilderCodec.BuilderBase<T, S extends BuilderCodec.BuilderBase<T,S> >
java.lang.Object
com.hypixel.hytale.codec.builder.BuilderCodec.BuilderBase<T,S>
- Direct Known Subclasses:
AssetBuilderCodec.Builder, BuilderCodec.Builder
- Enclosing class:
BuilderCodec<T>
public abstract static class BuilderCodec.BuilderBase<T, S extends BuilderCodec.BuilderBase<T,S>>
extends Object
- Since:
- 18/8/17.
- Version:
- 1.0
-
Method Summary
Modifier and TypeMethodDescription<FieldType>
SaddField(BuilderField<T, FieldType> entry) <FieldType>
SaddField(KeyedCodec<FieldType> codec, BiConsumer<T, FieldType> setter, Function<T, FieldType> getter) Deprecated.afterDecode(BiConsumer<T, ExtraInfo> afterDecode) afterDecode(Consumer<T> afterDecode) <FieldType>
BuilderField.FieldBuilder<T, FieldType, S> append(KeyedCodec<FieldType> codec, TriConsumer<T, FieldType, ExtraInfo> setter, BiFunction<T, ExtraInfo, FieldType> getter) <FieldType>
BuilderField.FieldBuilder<T, FieldType, S> append(KeyedCodec<FieldType> codec, BiConsumer<T, FieldType> setter, Function<T, FieldType> getter) <FieldType>
BuilderField.FieldBuilder<T, FieldType, S> appendInherited(KeyedCodec<FieldType> codec, TriConsumer<T, FieldType, ExtraInfo> setter, BiFunction<T, ExtraInfo, FieldType> getter, TriConsumer<T, T, ExtraInfo> inherit) <FieldType>
BuilderField.FieldBuilder<T, FieldType, S> appendInherited(KeyedCodec<FieldType> codec, BiConsumer<T, FieldType> setter, Function<T, FieldType> getter, BiConsumer<T, T> inherit) build()codecVersion(int codecVersion) codecVersion(int minCodecVersion, int codecVersion) documentation(String doc) Deprecated.Used to allow builder codecs to fetch the version information fromExtraInfo.getLegacyVersion()for backwards compatvalidator(BiConsumer<T, ValidationResults> validator) Deprecated.Marks the codec as versioned.
-
Method Details
-
documentation
-
versioned
Marks the codec as versioned.When a codec is versioned it stores version information along with the rest of the serialized data. This version will affect all fields within the codec and any version specific handling within any of the codecs of those fields (e.g. a nested BuilderCodec) unless that codec is versioned itself.
A codec doesn't have to be versioned in order to use methods such as
BuilderField.FieldBuilder.setVersionRange(int, int). When the codec isn't versioned itself it will inherit the version parent codec (orExtraInfoas a fallback). -
legacyVersioned
Deprecated.Used to allow builder codecs to fetch the version information fromExtraInfo.getLegacyVersion()for backwards compat -
addField
@Nonnull @Deprecated public <FieldType> S addField(@Nonnull KeyedCodec<FieldType> codec, @Nonnull BiConsumer<T, FieldType> setter, @Nonnull Function<T, FieldType> getter) Deprecated.Please useappend(KeyedCodec, BiConsumer, Function)orappendInherited(KeyedCodec, BiConsumer, Function, BiConsumer)instead as they allow you to provide documentation and validation. -
append
@Nonnull public <FieldType> BuilderField.FieldBuilder<T, FieldType, S> append(KeyedCodec<FieldType> codec, @Nonnull BiConsumer<T, FieldType> setter, @Nonnull Function<T, FieldType> getter) -
append
@Nonnull public <FieldType> BuilderField.FieldBuilder<T, FieldType, S> append(KeyedCodec<FieldType> codec, TriConsumer<T, FieldType, ExtraInfo> setter, BiFunction<T, ExtraInfo, FieldType> getter) -
appendInherited
@Nonnull public <FieldType> BuilderField.FieldBuilder<T, FieldType, S> appendInherited(KeyedCodec<FieldType> codec, @Nonnull BiConsumer<T, FieldType> setter, @Nonnull Function<T, FieldType> getter, @Nonnull BiConsumer<T, T> inherit) -
appendInherited
@Nonnull public <FieldType> BuilderField.FieldBuilder<T, FieldType, S> appendInherited(KeyedCodec<FieldType> codec, TriConsumer<T, FieldType, ExtraInfo> setter, BiFunction<T, ExtraInfo, FieldType> getter, TriConsumer<T, T, ExtraInfo> inherit) -
addField
-
afterDecode
-
afterDecode
-
validator
Deprecated. -
metadata
-
codecVersion
-
codecVersion
-
build
-
append(KeyedCodec, BiConsumer, Function)orappendInherited(KeyedCodec, BiConsumer, Function, BiConsumer)instead as they allow you to provide documentation and validation.