Class AcquireResult.Acquired

java.lang.Object
me.ahoo.cosid.lease.AcquireResult.Acquired
All Implemented Interfaces:
AcquireResult
Enclosing interface:
AcquireResult

public static final class AcquireResult.Acquired extends Object implements AcquireResult
A slot was acquired. Immutable; built with builder(SlotLease, AcquireReason), the only way to create one, so fields can be added with a default (api-freeze.md §4).
  • Method Details

    • builder

      public static AcquireResult.Acquired.Builder builder(SlotLease lease, AcquireReason reason)
      A builder of an acquisition.
      Parameters:
      lease - the lease
      reason - which step of the slot choice gave the slot (§2.1)
      Returns:
      the builder
    • lease

      public SlotLease lease()
      The lease.
      Returns:
      the lease
    • reason

      public AcquireReason reason()
      Which step of the slot choice gave the slot (§2.1).
      Returns:
      the reason
    • duplicateOwnerKey

      public boolean duplicateOwnerKey()
      Whether another incarnation of the owner key holds a live lease in the namespace, as two runtimes started with one identity would.
      Returns:
      whether the owner key is held twice; default false
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object