Package dev.morphia.utils
Class Assert
- java.lang.Object
-
- dev.morphia.utils.Assert
-
public final class Assert extends Object
Provides various assertions for Morphia during validationDeveloper note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
parameterNotEmpty(String name, Iterable obj)
Validates that the Iterable is not emptystatic void
parameterNotEmpty(String name, String value)
Validates that the value is not emptystatic void
parametersNotNull(String names, Object... objects)
Validates that all the parameters are not nullstatic void
raiseError(String error)
Throws an QueryException with the given error message.
-
-
-
Method Detail
-
raiseError
public static void raiseError(String error)
Throws an QueryException with the given error message.- Parameters:
error
- the error message
-
parametersNotNull
public static void parametersNotNull(String names, Object... objects)
Validates that all the parameters are not null- Parameters:
names
- a comma separated String of parameter namesobjects
- the proposed parameter values
-
parameterNotEmpty
public static void parameterNotEmpty(String name, Iterable obj)
Validates that the Iterable is not empty- Parameters:
name
- the parameter nameobj
- the proposed parameter value
-
-