Package com.hypixel.hytale.component
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final BuilderCodec<T> The field for thecodecrecord component.private final ComponentType<ECS_TYPE, T> The field for thecomponentTyperecord component.private final StringThe field for theidrecord component.The field for thesupplierrecord component.The field for thetypeClassrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionComponentRegistration(Class<? super T> typeClass, String id, BuilderCodec<T> codec, Supplier<T> supplier, ComponentType<ECS_TYPE, T> componentType) Creates an instance of aComponentRegistrationrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncodec()Returns the value of thecodecrecord component.Returns the value of thecomponentTyperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.supplier()Returns the value of thesupplierrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetypeClassrecord component.
-
Field Details
-
typeClass
The field for thetypeClassrecord component. -
id
The field for theidrecord component. -
codec
The field for thecodecrecord component. -
supplier
The field for thesupplierrecord component. -
componentType
The field for thecomponentTyperecord 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 aComponentRegistrationrecord class.- Parameters:
typeClass- the value for thetypeClassrecord componentid- the value for theidrecord componentcodec- the value for thecodecrecord componentsupplier- the value for thesupplierrecord componentcomponentType- the value for thecomponentTyperecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
typeClass
Returns the value of thetypeClassrecord component.- Returns:
- the value of the
typeClassrecord component
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
codec
Returns the value of thecodecrecord component.- Returns:
- the value of the
codecrecord component
-
supplier
Returns the value of thesupplierrecord component.- Returns:
- the value of the
supplierrecord component
-
componentType
Returns the value of thecomponentTyperecord component.- Returns:
- the value of the
componentTyperecord component
-