Class FFM.GroupBinderBuilder<T, L extends GroupLayout, M extends GroupBinder<L,T>, SELF extends FFM.GroupBinderBuilder<T,L,M,SELF>>

java.lang.Object
org.lwjgl.system.ffm.FFM.GroupLayoutBuilder<L,M,SELF>
org.lwjgl.system.ffm.FFM.GroupBinderBuilder<T,L,M,SELF>
Direct Known Subclasses:
FFM.StructBinderBuilder, FFM.UnionBinderBuilder
Enclosing class:
FFM

public abstract static sealed class FFM.GroupBinderBuilder<T, L extends GroupLayout, M extends GroupBinder<L,T>, SELF extends FFM.GroupBinderBuilder<T,L,M,SELF>> extends FFM.GroupLayoutBuilder<L,M,SELF> permits FFM.StructBinderBuilder<T>, FFM.UnionBinderBuilder<T>
Base class for struct/union binder builders.
See Also:
  • Method Details

    • build

      public M build()
      Generates a class that implements the GroupBinder interface for the group type using the current builder state, then returns a new instance of that class.
      Returns:
      the GroupBinder implementation
    • withEquals

      public SELF withEquals(BiPredicate<T,Object> equals)
      Sets a custom Object.equals(Object) implementation for the group.

      By default, an equals method will be generated with the same semantics as Record.equals(Object), where the canonical getters act as components. This means that the default implementation will not consider padding members or members with no corresponding getters.

      Parameters:
      equals - the equals implementation
      Returns:
      this builder instance
      See Also:
    • withHashCode

      public SELF withHashCode(ToIntFunction<T> hashCode)
      Sets a custom Object.hashCode() implementation for the group.

      By default, a hashCode method will be generated with the same semantics as Record.hashCode(), where the canonical getters act as components. This means that the default implementation will not consider padding members or members with no corresponding getters.

      Parameters:
      hashCode - the hashCode implementation
      Returns:
      this builder instance
      See Also:
    • withToString

      public SELF withToString(Function<T,String> toString)
      Sets a custom Object.toString() implementation for the group.

      By default, a toString method will be generated with the same semantics as Record.toString(), where the canonical getters act as components. This means that the default implementation will not consider padding members or members with no corresponding getters.

      Parameters:
      toString - the toString implementation
      Returns:
      this builder instance
      See Also: