Class Preconditions


  • public final class Preconditions
    extends Object
    • Method Detail

      • assertPositive

        public static long assertPositive​(long n,
                                          @NonNull
                                          String name)
      • assertPositive

        public static int assertPositive​(int n,
                                         @NonNull
                                         String name)
      • assertNegative

        public static long assertNegative​(long n,
                                          @NonNull
                                          String name)
      • assertNegative

        public static int assertNegative​(int n,
                                         @NonNull
                                         String name)
      • assertNotNegative

        public static long assertNotNegative​(long n,
                                             @NonNull
                                             String name)
      • assertNotNegative

        public static int assertNotNegative​(int n,
                                            @NonNull
                                            String name)
      • assertZero

        public static long assertZero​(long n,
                                      @NonNull
                                      String name)
      • assertZero

        public static int assertZero​(int n,
                                     @NonNull
                                     String name)
      • assertNotZero

        public static long assertNotZero​(long n,
                                         @NonNull
                                         String name)
      • assertNotZero

        public static int assertNotZero​(int n,
                                        @NonNull
                                        String name)
      • assertNotNull

        @NonNull
        public static <T> T assertNotNull​(@Nullable
                                          T obj,
                                          @NonNull
                                          String name)
      • assertNotEmpty

        @NonNull
        public static String assertNotEmpty​(@Nullable
                                            String str,
                                            @NonNull
                                            String name)
      • assertNotEmpty

        @NonNull
        public static <K extends Collection<T>,​T> K assertNotEmpty​(@Nullable
                                                                         K obj,
                                                                         @NonNull
                                                                         String name)
      • assertThat

        @Nullable
        public static <T> T assertThat​(@Nullable
                                       T obj,
                                       @NonNull
                                       String msg,
                                       @NonNull
                                       Fn.Predicate<T> predicate)