Package com.linkedin.alpini.base.misc
Enum Preconditions
- java.lang.Object
-
- java.lang.Enum<Preconditions>
-
- com.linkedin.alpini.base.misc.Preconditions
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Preconditions>
public enum Preconditions extends java.lang.Enum<Preconditions>
Utility methods for precondition checks.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description SINGLETON
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
between(int value, java.lang.String name, int min, int max)
static void
checkState(boolean state)
static void
checkState(boolean state, java.lang.String message)
static boolean
isNullOrEmpty(java.lang.String text)
static int
notLessThan(int value, int level, java.lang.String message)
static long
notLessThan(long value, long level, java.lang.String message)
static java.lang.String
requireNotEmpty(java.lang.String text)
static java.lang.String
requireNotEmpty(java.lang.String text, java.lang.String message)
static Preconditions
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Preconditions[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SINGLETON
public static final Preconditions SINGLETON
-
-
Method Detail
-
values
public static Preconditions[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Preconditions c : Preconditions.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Preconditions valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
isNullOrEmpty
public static boolean isNullOrEmpty(java.lang.String text)
-
requireNotEmpty
public static java.lang.String requireNotEmpty(java.lang.String text)
-
requireNotEmpty
public static java.lang.String requireNotEmpty(java.lang.String text, java.lang.String message)
-
checkState
public static void checkState(boolean state)
-
checkState
public static void checkState(boolean state, java.lang.String message)
-
notLessThan
public static int notLessThan(int value, int level, java.lang.String message)
-
notLessThan
public static long notLessThan(long value, long level, java.lang.String message)
-
between
public static int between(int value, java.lang.String name, int min, int max)
-
-