Class InMemorySherlock


  • public final class InMemorySherlock
    extends java.lang.Object
    Builds Sherlock that that stores locks in memory.

    Designed for testing purposes only.

    • 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 of Sherlock.
        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()