Package fr.ghostrider584.axiom.metadata
Record Class MetadataMapping<T>
java.lang.Object
java.lang.Record
fr.ghostrider584.axiom.metadata.MetadataMapping<T>
-
Constructor Summary
ConstructorsConstructorDescriptionMetadataMapping(@NotNull String path, net.minestom.server.entity.MetadataDef.Entry<T> metadataEntry, @NotNull net.minestom.server.codec.Codec<T> codec) Creates an instance of aMetadataMappingrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull net.minestom.server.codec.Codec<T> codec()Returns the value of thecodecrecord component.static <T> MetadataMapping<T> final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static <T> MetadataMapping<T> mapping(String path, net.minestom.server.entity.MetadataDef.Entry<T> entry, net.minestom.server.codec.Codec<T> codec) net.minestom.server.entity.MetadataDef.Entry<T> Returns the value of themetadataEntryrecord component.@NotNull Stringpath()Returns the value of thepathrecord component.static <T> MetadataMapping<net.minestom.server.registry.RegistryKey<T>> registry(String path, net.minestom.server.entity.MetadataDef.Entry<net.minestom.server.registry.RegistryKey<T>> entry, net.minestom.server.registry.Registries.Selector<T> selector) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MetadataMapping
public MetadataMapping(@NotNull @NotNull String path, @NotNull net.minestom.server.entity.MetadataDef.Entry<T> metadataEntry, @NotNull @NotNull net.minestom.server.codec.Codec<T> codec) Creates an instance of aMetadataMappingrecord class.- Parameters:
path- the value for thepathrecord componentmetadataEntry- the value for themetadataEntryrecord componentcodec- the value for thecodecrecord component
-
-
Method Details
-
registry
public static <T> MetadataMapping<net.minestom.server.registry.RegistryKey<T>> registry(String path, net.minestom.server.entity.MetadataDef.Entry<net.minestom.server.registry.RegistryKey<T>> entry, net.minestom.server.registry.Registries.Selector<T> selector) -
mapping
public static <T> MetadataMapping<T> mapping(String path, net.minestom.server.entity.MetadataDef.Entry<T> entry, net.minestom.server.codec.Codec<T> codec) -
direct
public static <T> MetadataMapping<T> direct(String path, net.minestom.server.entity.MetadataDef.Entry<T> entry) -
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). -
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
metadataEntry
Returns the value of themetadataEntryrecord component.- Returns:
- the value of the
metadataEntryrecord component
-
codec
Returns the value of thecodecrecord component.- Returns:
- the value of the
codecrecord component
-