Package io.hekate.lock
Class LockRegionConfig
- java.lang.Object
-
- io.hekate.lock.LockRegionConfig
-
public class LockRegionConfig extends Object
Configuration forLockRegion
.Instances of this class can be
registered
within theLockServiceFactory
in order to make particular lock region available in theLockService
.For more details about locks and regions please see the documentation of the
LockService
interface.
-
-
Constructor Summary
Constructors Constructor Description LockRegionConfig()
Constructs new instance.LockRegionConfig(String name)
Constructs new instance with the specified name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
Returns the lock region name (seesetName(String)
).void
setName(String name)
Sets the lock region name.String
toString()
LockRegionConfig
withName(String name)
Fluent-style version ofsetName(String)
.
-
-
-
Constructor Detail
-
LockRegionConfig
public LockRegionConfig()
Constructs new instance.
-
LockRegionConfig
public LockRegionConfig(String name)
Constructs new instance with the specified name.- Parameters:
name
- Name (seesetName(String)
).
-
-
Method Detail
-
getName
public String getName()
Returns the lock region name (seesetName(String)
).- Returns:
- Lock region name.
-
setName
public void setName(String name)
Sets the lock region name. Can contain only alpha-numeric characters and non-repeatable dots/hyphens.This name can be used to obtain reference to
LockRegion
viaLockService.region(String)
.Value of this parameter is mandatory and must be unique across all regions registered within the
LockServiceFactory
.- Parameters:
name
- Region name (can contain only alpha-numeric characters and non-repeatable dots/hyphens).
-
withName
public LockRegionConfig withName(String name)
Fluent-style version ofsetName(String)
.- Parameters:
name
- Region name.- Returns:
- This instance.
-
-