Record Class MetadataMapping<T>

java.lang.Object
java.lang.Record
fr.ghostrider584.axiom.metadata.MetadataMapping<T>
All Implemented Interfaces:
MappingEntry<T>

public record MetadataMapping<T>(@NotNull String path, net.minestom.server.entity.MetadataDef.Entry<T> entry, @NotNull net.minestom.server.codec.Codec<T> codec) extends Record implements MappingEntry<T>
  • Constructor Summary

    Constructors
    Constructor
    Description
    MetadataMapping(@NotNull String path, net.minestom.server.entity.MetadataDef.Entry<T> entry, @NotNull net.minestom.server.codec.Codec<T> codec)
    Creates an instance of a MetadataMapping record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull net.minestom.server.codec.Codec<T>
    Returns the value of the codec record component.
    static <T> MetadataMapping<T>
    direct(String path, net.minestom.server.entity.MetadataDef.Entry<T> entry)
     
    net.minestom.server.entity.MetadataDef.Entry<T>
    Returns the value of the entry record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    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)
     
    @NotNull String
    Returns the value of the path record 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 String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MetadataMapping

      public MetadataMapping(@NotNull @NotNull String path, @NotNull net.minestom.server.entity.MetadataDef.Entry<T> entry, @NotNull @NotNull net.minestom.server.codec.Codec<T> codec)
      Creates an instance of a MetadataMapping record class.
      Parameters:
      path - the value for the path record component
      entry - the value for the entry record component
      codec - the value for the codec record 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

      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.
    • path

      @NotNull public @NotNull String path()
      Returns the value of the path record component.
      Specified by:
      path in interface MappingEntry<T>
      Returns:
      the value of the path record component
    • entry

      @NotNull public net.minestom.server.entity.MetadataDef.Entry<T> entry()
      Returns the value of the entry record component.
      Specified by:
      entry in interface MappingEntry<T>
      Returns:
      the value of the entry record component
    • codec

      @NotNull public @NotNull net.minestom.server.codec.Codec<T> codec()
      Returns the value of the codec record component.
      Specified by:
      codec in interface MappingEntry<T>
      Returns:
      the value of the codec record component