Package liquibase.util
Class ValueHandlerUtil
- java.lang.Object
-
- liquibase.util.ValueHandlerUtil
-
public class ValueHandlerUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringARGUMENT_KEY
-
Constructor Summary
Constructors Constructor Description ValueHandlerUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BooleanbooleanValueHandler(Object input)static <T extends Enum<T>>
TgetEnum(Class<T> enumClass, Object input, String parameterName)Get the valid enum value from a configuration parameter if possible.static IntegergetIntegerWithConstraints(Object input, String errorMessage, List<Integer> validValues)Get an integer entry, with constraints.
-
-
-
Field Detail
-
ARGUMENT_KEY
public static String ARGUMENT_KEY
-
-
Method Detail
-
getEnum
public static <T extends Enum<T>> T getEnum(Class<T> enumClass, Object input, String parameterName)
Get the valid enum value from a configuration parameter if possible.- Parameters:
enumClass- the enum to useinput- the configuration input to search the enumClassparameterName- the name to report to the user if no valid enum values are found- Returns:
- the enum value or null
-
getIntegerWithConstraints
public static Integer getIntegerWithConstraints(Object input, String errorMessage, List<Integer> validValues)
Get an integer entry, with constraints.- Parameters:
input- the user supplied inputerrorMessage- the error message that should be returned if none of the valid values match. This message should end with the string "one of the allowed values: ", because the allowed values will be appended to this error message before it is used.validValues- the permissible values for the input
-
-