Record Class Hex32

java.lang.Object
java.lang.Record
dev.latvian.mods.klib.util.Hex32

public record Hex32(int raw) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<Hex32>
     
    static final DataType<Hex32>
     
    static final com.mojang.serialization.Codec<Hex32>
     
    static final Hex32
     
    static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,Hex32>
     
    static final com.mojang.serialization.Codec<Hex32>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Hex32(int raw)
    Creates an instance of a Hex32 record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Hex32
    crc32(Path file, @Nullable LongConsumer callback)
     
    boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    static Hex32
    of(int id)
     
    static Hex32
    of(String id)
     
    int
    raw()
    Returns the value of the raw record component.
    @NotNull String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • NONE

      public static final Hex32 NONE
    • STRING_CODEC

      public static final com.mojang.serialization.Codec<Hex32> STRING_CODEC
    • INT_CODEC

      public static final com.mojang.serialization.Codec<Hex32> INT_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<Hex32> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,Hex32> STREAM_CODEC
    • DATA_TYPE

      public static final DataType<Hex32> DATA_TYPE
  • Constructor Details

    • Hex32

      public Hex32(int raw)
      Creates an instance of a Hex32 record class.
      Parameters:
      raw - the value for the raw record component
  • Method Details

    • of

      public static Hex32 of(int id)
    • of

      public static Hex32 of(String id)
    • crc32

      public static Hex32 crc32(Path file, @Nullable @Nullable LongConsumer callback) throws IOException
      Throws:
      IOException
    • hashCode

      public 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 boolean equals(Object obj)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      obj - the object with which to compare
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • toString

      @NotNull public @NotNull 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
    • raw

      public int raw()
      Returns the value of the raw record component.
      Returns:
      the value of the raw record component