Contents
Record Class ResourceRegistration<ECS_TYPE, T extends Resource<ECS_TYPE>>
java.lang.Object
java.lang.Record
com.hypixel.hytale.component.ResourceRegistration<ECS_TYPE,T>
- Type Parameters:
ECS_TYPE- The store type.T- The resource type class.- Record Components:
typeClass- The type class of the associated resource.id- The unique identifier for this resource.codec- The codec instance used to parse instances of the resource.supplier- The supplier that provides a new instance of the resource.resourceType- The resource type associated with the resource.
public record ResourceRegistration<ECS_TYPE, T extends Resource<ECS_TYPE>>(@Nonnull Class<? super T extends Resource<ECS_TYPE>> typeClass, @Nullable String id, @Nullable BuilderCodec<T extends Resource<ECS_TYPE>> codec, @Nonnull Supplier<T extends Resource<ECS_TYPE>> supplier, @Nonnull ResourceType<ECS_TYPE, T extends Resource<ECS_TYPE>> resourceType)
extends Record
A class that represents the registration of a resource type.
-
Constructor Summary
ConstructorsConstructorDescriptionResourceRegistration(Class<? super T> typeClass, String id, BuilderCodec<T> codec, Supplier<T> supplier, ResourceType<ECS_TYPE, T> resourceType) Creates an instance of aResourceRegistrationrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncodec()Returns the value of thecodecrecord 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.Returns the value of theresourceTyperecord 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
-
ResourceRegistration
public ResourceRegistration(@Nonnull Class<? super T> typeClass, @Nullable String id, @Nullable BuilderCodec<T> codec, @Nonnull Supplier<T> supplier, @Nonnull ResourceType<ECS_TYPE, T> resourceType) Creates an instance of aResourceRegistrationrecord class.- Parameters:
typeClass- the value for thetypeClassrecord componentid- the value for theidrecord componentcodec- the value for thecodecrecord componentsupplier- the value for thesupplierrecord componentresourceType- the value for theresourceTyperecord 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
-
resourceType
Returns the value of theresourceTyperecord component.- Returns:
- the value of the
resourceTyperecord component
-