Class RecordBuilder

java.lang.Object
com.github.darksoulq.abyssallib.common.serialization.RecordBuilder

public class RecordBuilder extends Object
A structural builder utility mimicking standard DataFixerUpper logic. Facilitates the creation of complex object codecs by cleanly compounding multiple field definitions. Identifies and maps hierarchical data errors natively.
  • Constructor Details

    • RecordBuilder

      public RecordBuilder()
  • Method Details

    • create

      public static <O> Codec<O> create(Function<RecordBuilder.Instance, ? extends Codec<O>> builder)
      Initiates the creation of a compound RecordCodec.
      Type Parameters:
      O - The target object type.
      Parameters:
      builder - A function defining the group of fields and mapping them to the constructor.
      Returns:
      A newly constructed, fully functional Codec for the target object.