Contents
Record Class ComponentRegistration<ECS_TYPE, T extends Component<ECS_TYPE>>
java.lang.Object
java.lang.Record
com.hypixel.hytale.component.ComponentRegistration<ECS_TYPE,T>
- Type Parameters:
ECS_TYPE- The store type.T- The component type class.- Record Components:
typeClass- The type class of the associated component.id- The unique identifier for this component.codec- The codec instance used to parse instances of the component.supplier- The supplier that provides a new instance of the component.componentType- The component type associated with the component.
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
A class that represents the registration of a component type.
-
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.
-
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
-
hashCode
-
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
-
id
-
codec
-
supplier
-
componentType
Returns the value of thecomponentTyperecord component.- Returns:
- the value of the
componentTyperecord component
-