Record Class Clock

java.lang.Object
java.lang.Record
software.sava.core.accounts.sysvar.Clock
All Implemented Interfaces:
Borsh, Serializable

public record Clock(PublicKey address, long slot, long epochStartTimestamp, long epoch, long leaderScheduleEpoch, long unixTimestamp) extends Record implements Borsh
  • Nested Class Summary

    Nested classes/interfaces inherited from interface software.sava.core.borsh.Borsh

    Borsh.Enum, Borsh.Factory<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final BiFunction<PublicKey,byte[],Clock>
     
    static final long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Clock(PublicKey address, long slot, long epochStartTimestamp, long epoch, long leaderScheduleEpoch, long unixTimestamp)
    Creates an instance of a Clock record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the address record component.
    long
    Returns the value of the epoch record component.
    long
    Returns the value of the epochStartTimestamp record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    l()
     
    long
    Returns the value of the leaderScheduleEpoch record component.
    static Clock
    read(byte[] data)
     
    static Clock
    read(byte[] data, int offset)
     
    static Clock
    read(PublicKey address, byte[] data)
     
    static Clock
    read(PublicKey address, byte[] data, int offset)
     
    long
    Returns the value of the slot record component.
    final String
    Returns a string representation of this record class.
    long
    Returns the value of the unixTimestamp record component.
    int
    write(byte[] data, int offset)
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface software.sava.core.borsh.Borsh

    writeOptional

    Methods inherited from interface software.sava.core.serial.Serializable

    reusable, write, write
  • Field Details

  • Constructor Details

    • Clock

      public Clock(PublicKey address, long slot, long epochStartTimestamp, long epoch, long leaderScheduleEpoch, long unixTimestamp)
      Creates an instance of a Clock record class.
      Parameters:
      address - the value for the address record component
      slot - the value for the slot record component
      epochStartTimestamp - the value for the epochStartTimestamp record component
      epoch - the value for the epoch record component
      leaderScheduleEpoch - the value for the leaderScheduleEpoch record component
      unixTimestamp - the value for the unixTimestamp record component
  • Method Details

    • read

      public static Clock read(byte[] data)
    • read

      public static Clock read(byte[] data, int offset)
    • read

      public static Clock read(PublicKey address, byte[] data)
    • read

      public static Clock read(PublicKey address, byte[] data, int offset)
    • write

      public int write(byte[] data, int offset)
      Specified by:
      write in interface Serializable
    • l

      public int l()
      Specified by:
      l in interface Serializable
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • address

      public PublicKey address()
      Returns the value of the address record component.
      Returns:
      the value of the address record component
    • slot

      public long slot()
      Returns the value of the slot record component.
      Returns:
      the value of the slot record component
    • epochStartTimestamp

      public long epochStartTimestamp()
      Returns the value of the epochStartTimestamp record component.
      Returns:
      the value of the epochStartTimestamp record component
    • epoch

      public long epoch()
      Returns the value of the epoch record component.
      Returns:
      the value of the epoch record component
    • leaderScheduleEpoch

      public long leaderScheduleEpoch()
      Returns the value of the leaderScheduleEpoch record component.
      Returns:
      the value of the leaderScheduleEpoch record component
    • unixTimestamp

      public long unixTimestamp()
      Returns the value of the unixTimestamp record component.
      Returns:
      the value of the unixTimestamp record component