Package me.ahoo.cosid.proxy.api
Record Class LeaseDto
java.lang.Object
java.lang.Record
me.ahoo.cosid.proxy.api.LeaseDto
- Record Components:
namespace- the namespaceinstanceId- the instance holding the machine idstable- whether the instance is stablemachineId- the machine idwatermark- the last timestamp the machine id may have been used forrenewedAt- the store time of the last claim or renewalversion- the token that changes on every write
public record LeaseDto(String namespace, String instanceId, boolean stable, int machineId, long watermark, long renewedAt, long version)
extends Record
A machine id lease on the wire.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinstanceIdrecord component.intReturns the value of themachineIdrecord component.Returns the value of thenamespacerecord component.static LeaseDtolongReturns the value of therenewedAtrecord component.booleanstable()Returns the value of thestablerecord component.toLease()final StringtoString()Returns a string representation of this record class.longversion()Returns the value of theversionrecord component.longReturns the value of thewatermarkrecord component.
-
Constructor Details
-
LeaseDto
public LeaseDto(String namespace, String instanceId, boolean stable, int machineId, long watermark, long renewedAt, long version) Creates an instance of aLeaseDtorecord class.- Parameters:
namespace- the value for thenamespacerecord componentinstanceId- the value for theinstanceIdrecord componentstable- the value for thestablerecord componentmachineId- the value for themachineIdrecord componentwatermark- the value for thewatermarkrecord componentrenewedAt- the value for therenewedAtrecord componentversion- the value for theversionrecord component
-
-
Method Details
-
of
-
toLease
-
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 '=='. -
namespace
Returns the value of thenamespacerecord component.- Returns:
- the value of the
namespacerecord component
-
instanceId
Returns the value of theinstanceIdrecord component.- Returns:
- the value of the
instanceIdrecord component
-
stable
public boolean stable()Returns the value of thestablerecord component.- Returns:
- the value of the
stablerecord component
-
machineId
public int machineId()Returns the value of themachineIdrecord component.- Returns:
- the value of the
machineIdrecord component
-
watermark
public long watermark()Returns the value of thewatermarkrecord component.- Returns:
- the value of the
watermarkrecord component
-
renewedAt
public long renewedAt()Returns the value of therenewedAtrecord component.- Returns:
- the value of the
renewedAtrecord component
-
version
public long version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-