Record Class MetadataMapping<T>

java.lang.Object
java.lang.Record
fr.ghostrider584.axiom.metadata.MetadataMapping<T>

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

    Constructors
    Constructor
    Description
    MetadataMapping(@NotNull String path, net.minestom.server.entity.MetadataDef.Entry<T> metadataEntry, @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)
     
    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)
     
    net.minestom.server.entity.MetadataDef.Entry<T>
    Returns the value of the metadataEntry record component.
    @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 java.lang.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> metadataEntry, @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
      metadataEntry - the value for the metadataEntry 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.
      Returns:
      the value of the path record component
    • metadataEntry

      @NotNull public net.minestom.server.entity.MetadataDef.Entry<T> metadataEntry()
      Returns the value of the metadataEntry record component.
      Returns:
      the value of the metadataEntry record component
    • codec

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