Class RecordCodec.AbstractBuilder<T>

java.lang.Object
com.hypixel.hytale.codec.record.RecordCodec.AbstractBuilder<T>
Direct Known Subclasses:
RecordCodec.Builder0, RecordCodec.Builder1, RecordCodec.Builder2, RecordCodec.Builder3, RecordCodec.Builder4, RecordCodec.Builder5, RecordCodec.Builder6, RecordCodec.Builder7, RecordCodec.Builder8, RecordCodec.RawBuilder
Enclosing class:
RecordCodec<T>

public abstract static sealed class RecordCodec.AbstractBuilder<T> extends Object permits RecordCodec.Builder0<T>, RecordCodec.Builder1<T,A>, RecordCodec.Builder2<T,A,B>, RecordCodec.Builder3<T,A,B,C>, RecordCodec.Builder4<T,A,B,C,D>, RecordCodec.Builder5<T,A,B,C,D,E>, RecordCodec.Builder6<T,A,B,C,D,E,F>, RecordCodec.Builder7<T,A,B,C,D,E,F,G>, RecordCodec.Builder8<T,A,B,C,D,E,F,G,H>, RecordCodec.RawBuilder<T>
A step in the typed builder chain for a RecordCodec. Each append registers one field in constructor parameter order and returns the next step, whose generic parameters track the field types appended so far so the terminal build is checked against the constructor. Builder0 through Builder8 differ only in arity and each repeat the same three append overloads so the return type can advance the chain; the shared logic lives in addField(KeyedCodec, Function), so a change to an append signature has to be mirrored across all of them. RecordCodec.RawBuilder is the exception: its append returns this and it has no typed build, so callers finish through buildRaw(Function).
  • Method Details

    • buildRaw

      @Nonnull public RecordCodec<T> buildRaw(@Nonnull Function<Object[],T> constructor)
      Builds the codec from an untyped constructor that reads the decoded fields out of the argument array in append order. Prefer the typed build overloads where possible.