Record Class ComponentRegistration<ECS_TYPE,T extends Component<ECS_TYPE>>

java.lang.Object
java.lang.Record
com.hypixel.hytale.component.ComponentRegistration<ECS_TYPE,T>

public record ComponentRegistration<ECS_TYPE,T extends Component<ECS_TYPE>>(@Nonnull Class<? super T extends Component<ECS_TYPE>> typeClass, @Nullable String id, @Nullable BuilderCodec<T extends Component<ECS_TYPE>> codec, @Nonnull Supplier<T extends Component<ECS_TYPE>> supplier, @Nonnull ComponentType<ECS_TYPE,T extends Component<ECS_TYPE>> componentType) extends Record
  • Field Details

    • typeClass

      @Nonnull private final Class<? super T extends Component<ECS_TYPE>> typeClass
      The field for the typeClass record component.
    • id

      @Nullable private final String id
      The field for the id record component.
    • codec

      @Nullable private final BuilderCodec<T extends Component<ECS_TYPE>> codec
      The field for the codec record component.
    • supplier

      @Nonnull private final Supplier<T extends Component<ECS_TYPE>> supplier
      The field for the supplier record component.
    • componentType

      @Nonnull private final ComponentType<ECS_TYPE,T extends Component<ECS_TYPE>> componentType
      The field for the componentType record component.
  • Constructor Details

    • ComponentRegistration

      public ComponentRegistration(@Nonnull Class<? super T> typeClass, @Nullable String id, @Nullable BuilderCodec<T> codec, @Nonnull Supplier<T> supplier, @Nonnull ComponentType<ECS_TYPE,T> componentType)
      Creates an instance of a ComponentRegistration record class.
      Parameters:
      typeClass - the value for the typeClass record component
      id - the value for the id record component
      codec - the value for the codec record component
      supplier - the value for the supplier record component
      componentType - the value for the componentType record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • typeClass

      @Nonnull public Class<? super T> typeClass()
      Returns the value of the typeClass record component.
      Returns:
      the value of the typeClass record component
    • id

      @Nullable public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • codec

      @Nullable public BuilderCodec<T> codec()
      Returns the value of the codec record component.
      Returns:
      the value of the codec record component
    • supplier

      @Nonnull public Supplier<T> supplier()
      Returns the value of the supplier record component.
      Returns:
      the value of the supplier record component
    • componentType

      @Nonnull public ComponentType<ECS_TYPE,T> componentType()
      Returns the value of the componentType record component.
      Returns:
      the value of the componentType record component