Package de.xima.fc.prompt.mgmt.service
Class Locked<Lock,Item>
- java.lang.Object
-
- de.xima.fc.prompt.mgmt.service.Locked<Lock,Item>
-
- Type Parameters:
Lock- The type of the lockItem- 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:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()Itemitem()The item being locked.Locklock()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.
-
-
-
Method Detail
-
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 itemitem- 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 itemitem- the item being locked- Returns:
- A new Locked instance
-
-