Package me.ahoo.cosid.proxy.api
Record Class ClaimRequest
java.lang.Object
java.lang.Record
me.ahoo.cosid.proxy.api.ClaimRequest
- Record Components:
instanceId- the claiming instancestable- whether the instance is stablenow- the store time fromGET machines/v2/timemaxMachineId- the largest machine id allowed (not used by a self claim)expiredBefore- leases renewed at or before this time are expired (only for an expired claim)
public record ClaimRequest(String instanceId, boolean stable, long now, int maxMachineId, long expiredBefore)
extends Record
A claim of a machine id lease: the arguments of the
MachineLeaseStore claims.-
Constructor Summary
ConstructorsConstructorDescriptionClaimRequest(String instanceId, boolean stable, long now, int maxMachineId, long expiredBefore) Creates an instance of aClaimRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the value of theexpiredBeforerecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinstanceIdrecord component.intReturns the value of themaxMachineIdrecord component.longnow()Returns the value of thenowrecord component.booleanstable()Returns the value of thestablerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ClaimRequest
public ClaimRequest(String instanceId, boolean stable, long now, int maxMachineId, long expiredBefore) Creates an instance of aClaimRequestrecord class.- Parameters:
instanceId- the value for theinstanceIdrecord componentstable- the value for thestablerecord componentnow- the value for thenowrecord componentmaxMachineId- the value for themaxMachineIdrecord componentexpiredBefore- the value for theexpiredBeforerecord component
-
-
Method Details
-
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 '=='. -
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
-
now
public long now()Returns the value of thenowrecord component.- Returns:
- the value of the
nowrecord component
-
maxMachineId
public int maxMachineId()Returns the value of themaxMachineIdrecord component.- Returns:
- the value of the
maxMachineIdrecord component
-
expiredBefore
public long expiredBefore()Returns the value of theexpiredBeforerecord component.- Returns:
- the value of the
expiredBeforerecord component
-