Class InMemorySherlockBuilder


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

    Designed for testing purposes only.

    • Method Detail

      • inMemorySherlockBuilder

        public static InMemorySherlockBuilder inMemorySherlockBuilder()
        Returns:
        new instance of the builder
      • inMemorySherlock

        public static com.coditory.sherlock.Sherlock inMemorySherlock()
        Returns:
        new instance iof in memory sherlock with default configuration
      • withClock

        public InMemorySherlockBuilder withClock​(java.time.Clock clock)
        Parameters:
        clock - time provider used in locking mechanism. Default: SherlockDefaults.DEFAULT_CLOCK
        Returns:
        the instance
      • withSharedStorage

        public InMemorySherlockBuilder 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()