java.lang.Object
java.lang.Record
software.sava.core.accounts.sysvar.Clock
- All Implemented Interfaces:
Borsh,Serializable
-
Nested Class Summary
Nested classes/interfaces inherited from interface software.sava.core.borsh.Borsh
Borsh.Enum, Borsh.Factory<T> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddress()Returns the value of theaddressrecord component.longepoch()Returns the value of theepochrecord component.longReturns the value of theepochStartTimestamprecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intl()longReturns the value of theleaderScheduleEpochrecord component.static Clockread(byte[] data) static Clockread(byte[] data, int offset) static Clockstatic Clocklongslot()Returns the value of theslotrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of theunixTimestamprecord component.intwrite(byte[] data, int offset) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.sava.core.borsh.Borsh
writeOptionalMethods inherited from interface software.sava.core.serial.Serializable
reusable, write, write
-
Field Details
-
MAX_SLOT
public static final long MAX_SLOT- See Also:
-
BYTES
public static final int BYTES- See Also:
-
FACTORY
-
-
Constructor Details
-
Clock
public Clock(PublicKey address, long slot, long epochStartTimestamp, long epoch, long leaderScheduleEpoch, long unixTimestamp) Creates an instance of aClockrecord class.- Parameters:
address- the value for theaddressrecord componentslot- the value for theslotrecord componentepochStartTimestamp- the value for theepochStartTimestamprecord componentepoch- the value for theepochrecord componentleaderScheduleEpoch- the value for theleaderScheduleEpochrecord componentunixTimestamp- the value for theunixTimestamprecord component
-
-
Method Details
-
read
-
read
-
read
-
read
-
write
public int write(byte[] data, int offset) - Specified by:
writein interfaceSerializable
-
l
public int l()- Specified by:
lin interfaceSerializable
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
address
Returns the value of theaddressrecord component.- Returns:
- the value of the
addressrecord component
-
slot
public long slot()Returns the value of theslotrecord component.- Returns:
- the value of the
slotrecord component
-
epochStartTimestamp
public long epochStartTimestamp()Returns the value of theepochStartTimestamprecord component.- Returns:
- the value of the
epochStartTimestamprecord component
-
epoch
public long epoch()Returns the value of theepochrecord component.- Returns:
- the value of the
epochrecord component
-
leaderScheduleEpoch
public long leaderScheduleEpoch()Returns the value of theleaderScheduleEpochrecord component.- Returns:
- the value of the
leaderScheduleEpochrecord component
-
unixTimestamp
public long unixTimestamp()Returns the value of theunixTimestamprecord component.- Returns:
- the value of the
unixTimestamprecord component
-