Record Class SHA1

java.lang.Object
java.lang.Record
dev.latvian.mods.klib.io.checksum.SHA1
All Implemented Interfaces:
Checksum

public record SHA1(long a, long b, int c) extends Record implements Checksum
  • Field Summary

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

    Constructors
    Constructor
    Description
    SHA1(long a, long b, int c)
    Creates an instance of a SHA1 record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    a()
    Returns the value of the a record component.
    long
    b()
    Returns the value of the b record component.
    int
    c()
    Returns the value of the c record component.
    boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    boolean
     
    static SHA1
    of(byte[] bytes)
     
    static SHA1
    of(long a, long b, int c)
     
    byte[]
     
    @NotNull String
    Returns a string representation of this record class.
     
    void
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface dev.latvian.mods.klib.io.checksum.Checksum

    writeFully
  • Field Details

    • NIL

      public static final SHA1 NIL
    • TYPE

      public static final ChecksumType<SHA1> TYPE
    • CODEC

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

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

      public static final DataType<SHA1> DATA_TYPE
  • Constructor Details

    • SHA1

      public SHA1(long a, long b, int c)
      Creates an instance of a SHA1 record class.
      Parameters:
      a - the value for the a record component
      b - the value for the b record component
      c - the value for the c record component
  • Method Details

    • of

      public static SHA1 of(long a, long b, int c)
    • of

      public static SHA1 of(byte[] bytes)
    • type

      public ChecksumType<SHA1> type()
      Specified by:
      type in interface Checksum
    • 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
    • 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.
    • isNil

      public boolean isNil()
      Specified by:
      isNil in interface Checksum
    • toByteArray

      public byte[] toByteArray()
      Specified by:
      toByteArray in interface Checksum
    • write

      public void write(ByteOutput data) throws IOException
      Specified by:
      write in interface Checksum
      Throws:
      IOException
    • a

      public long a()
      Returns the value of the a record component.
      Returns:
      the value of the a record component
    • b

      public long b()
      Returns the value of the b record component.
      Returns:
      the value of the b record component
    • c

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