Class Preconditions

java.lang.Object
com.coditory.sherlock.Preconditions

public final class Preconditions extends Object
Preconditions for sherlock distributed lock. Throws IllegalArgumentException if precondition is not met.
  • Method Details

    • expect

      public static void expect(boolean check, String message, Object... args)
    • expectEqual

      public static <T> T expectEqual(T value, T expected)
    • expectEqual

      public static <T> T expectEqual(T value, T expected, String message)
    • expectNonEmpty

      public static <K, E> Map<K,E> expectNonEmpty(Map<K,E> map)
    • expectNonEmpty

      public static <K, E> Map<K,E> expectNonEmpty(Map<K,E> map, String message)
    • expectNonNull

      public static <T> T expectNonNull(T value, String name)
    • expectNonEmpty

      public static <T> List<T> expectNonEmpty(List<T> values, String name)
    • expectNonEmpty

      public static String expectNonEmpty(String value, String name)
    • expectTruncatedToMillis

      public static Duration expectTruncatedToMillis(Duration value, String name)