Record Class ClaimRequest

java.lang.Object
java.lang.Record
me.ahoo.cosid.proxy.api.ClaimRequest
Record Components:
instanceId - the claiming instance
stable - whether the instance is stable
now - the store time from GET machines/v2/time
maxMachineId - 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

    Constructors
    Constructor
    Description
    ClaimRequest(String instanceId, boolean stable, long now, int maxMachineId, long expiredBefore)
    Creates an instance of a ClaimRequest record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Returns the value of the expiredBefore record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the instanceId record component.
    int
    Returns the value of the maxMachineId record component.
    long
    now()
    Returns the value of the now record component.
    boolean
    Returns the value of the stable record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ClaimRequest

      public ClaimRequest(String instanceId, boolean stable, long now, int maxMachineId, long expiredBefore)
      Creates an instance of a ClaimRequest record class.
      Parameters:
      instanceId - the value for the instanceId record component
      stable - the value for the stable record component
      now - the value for the now record component
      maxMachineId - the value for the maxMachineId record component
      expiredBefore - the value for the expiredBefore record component
  • Method Details

    • 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.
    • instanceId

      public String instanceId()
      Returns the value of the instanceId record component.
      Returns:
      the value of the instanceId record component
    • stable

      public boolean stable()
      Returns the value of the stable record component.
      Returns:
      the value of the stable record component
    • now

      public long now()
      Returns the value of the now record component.
      Returns:
      the value of the now record component
    • maxMachineId

      public int maxMachineId()
      Returns the value of the maxMachineId record component.
      Returns:
      the value of the maxMachineId record component
    • expiredBefore

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