Class Locked<Lock,Item>

java.lang.Object
de.xima.fc.prompt.mgmt.service.Locked<Lock,Item>
Type Parameters:
Lock - The type of the lock
Item - The type of the item being locked
All Implemented Interfaces:
Serializable

public final class Locked<Lock,Item> extends Object implements Serializable
Represents an item that is locked by a specific lock. Contains both the lock and the item.
Since:
8.5.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
     
    The item being locked.
    The lock associated with the item.
    static <Lock,Item>
    Locked<Lock,Item>
    locked(Lock lock, Item item)
    Creates a new locked instance with the given lock and item.
    static <Lock,Item>
    Locked<Lock,Item>
    of(Lock lock, Item item)
    Creates a new locked instance with the given lock and item.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • equals

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

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

      public Item item()
      The item being locked.
      Returns:
      The item being locked
    • lock

      public Lock lock()
      The lock associated with the item.
      Returns:
      The lock associated with the item
    • of

      public static <Lock,Item> Locked<Lock,Item> of(Lock lock, Item item)
      Creates a new locked instance with the given lock and item.
      Parameters:
      lock - the lock associated with the item
      item - the item being locked
      Returns:
      A new Locked instance
    • locked

      public static <Lock,Item> Locked<Lock,Item> locked(Lock lock, Item item)
      Creates a new locked instance with the given lock and item.
      Parameters:
      lock - the lock associated with the item
      item - the item being locked
      Returns:
      A new Locked instance