Package com.coditory.sherlock
Class InMemorySherlock
- java.lang.Object
-
- com.coditory.sherlock.InMemorySherlock
-
public final class InMemorySherlock extends java.lang.ObjectBuildsSherlockthat that stores locks in memory.Designed for testing purposes only.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.coditory.sherlock.Sherlockbuild()static InMemorySherlockbuilder()static com.coditory.sherlock.SherlockinMemorySherlock()InMemorySherlockwithClock(java.time.Clock clock)TwithLockDuration(java.time.Duration arg0)TwithOwnerId(java.lang.String arg0)InMemorySherlockwithSharedStorage()Use shared stage for all instances ofSherlock.TwithStaticUniqueOwnerId()TwithUniqueOwnerId()
-
-
-
Method Detail
-
builder
public static InMemorySherlock builder()
- Returns:
- new instance of the builder
-
inMemorySherlock
public static com.coditory.sherlock.Sherlock inMemorySherlock()
-
withClock
public InMemorySherlock withClock(java.time.Clock clock)
- Parameters:
clock- time provider used in locking mechanism. Default:SherlockDefaults.DEFAULT_CLOCK- Returns:
- the instance
-
withSharedStorage
public InMemorySherlock withSharedStorage()
Use shared stage for all instances ofSherlock.- Returns:
- the instance
-
build
public com.coditory.sherlock.Sherlock build()
- Returns:
- sherlock instance
- Throws:
java.lang.IllegalArgumentException- when some required values are missing
-
withLockDuration
public T withLockDuration(java.time.Duration arg0)
-
withOwnerId
public T withOwnerId(java.lang.String arg0)
-
withUniqueOwnerId
public T withUniqueOwnerId()
-
withStaticUniqueOwnerId
public T withStaticUniqueOwnerId()
-
-