This page tries to compare Quality-Check with other classes like org.springframework.util.Assert [1] or com.google.common.base.Preconditions [2] or org.apache.commons.lang3.Validate [3] .
| Method of Check | Method of Assert |
|---|---|
| contains(Collection<T> haystack, T needle) | - |
| equals(T expected, T check) | - |
| greaterThan (T expected, T check) | - |
| greaterThan (T expected, T check) | - |
| hasAnnotation(Class<?> clazz, Class<? extends Annotation>annotation) | - |
| instanceOf(Class<?> type, Object obj) | isInstanceOf(Class<?> clazz, Object obj) |
| instanceOf(Class<?> type, Object obj, String name) | isInstanceOf(Class<?> type, Object obj, String message) |
| isNull (Object reference) | isNull (Object object) |
| isNull (Object reference, String name) | isNull (Object object, String message) |
| isNumber (String value) | - |
| isNumber (String value, String name) | - |
| isNumeric (T value) | - |
| isNumeric (T value, String name) | - |
| lesserThan (T expected, T check) | - |
| lesserThan (T expected, T check) | - |
| matchesPattern (Pattern pattern, T chars) | - |
| matchesPattern (Pattern pattern, T chars, String name) | - |
| noNullElements (T iterable) | - |
| noNullElements (T[] array) | noNullElements (Object[] array) |
| noNullElements (T[] array, String name) | noNullElements (Object[] array, String message) |
| noNullElements (T iterable, String name) | - |
| notEmpty (boolean expression) | - |
| notEmpty (boolean expression, String name) | - |
| notEmpty (T chars) | hasLength (String text) |
| notEmpty (T collection) | notEmpty (Collection collection, String message) |
| notEmpty (T map) | notEmpty (Map map) |
| notEmpty (T[] array) | notEmpty (Object[] array) |
| notEmpty (T[] array, String name) | notEmpty (Object[] array, String message) |
| notEmpty (T reference, boolean expression, String name) | - |
| notEmpty (T chars, String name) | hasLength (String text, String message) |
| notEmpty (T collection, String name) | notEmpty (Collection collection, String message) |
| notEmpty (T map, String name) | notEmpty (Map map, String message) |
| notNaN (double value) | - |
| notNaN (double value, String name) | - |
| notNaN (float value) | - |
| notNaN (float value, String name) | - |
| notNull (T reference) | notNull (Object object) |
| notNull (T reference, String name) | notNull (Object object, String message) |
| positionIndex (int index, int size) | - |
| range (int start, int end, int size) | - |
| stateIsTrue (boolean expression) | state (boolean expression) |
| stateIsTrue (boolean expression, Class<? extends RuntimeException> clazz) | - |
| stateIsTrue (boolean expression, String description) | state (boolean expression, String message) |
| stateIsTrue (boolean expression, String descriptionTemplate, Object... descriptionTemplateArgs) | - |
| Methods that are not directly supported by Check | |
| - | doesNotContain (String textToSearch, String substring) |
| - | doesNotContain (String textToSearch, String substring, String message) |
| - | hasText (String text) |
| - | hasText (String text, String message) |
| - | isAssignable (Class superType, Class subType) |
| - | isAssignable (Class superType, Class subType, String message) |
| - | isTrue (boolean expression) |
| - | isTrue (boolean expression, String message) |
| Method of Check | Method of Preconditions |
|---|---|
| contains(Collection<T> haystack, T needle) | - |
| equals(T expected, T check) | - |
| hasAnnotation(Class<?> clazz, Class<? extends Annotation>annotation) | - |
| instanceOf(Class<?> type, Object obj) | - |
| instanceOf(Class<?> type, Object obj, String name) | - |
| isNumber (String value) | - |
| isNumber (String value, String name) | - |
| isNumeric (T value) | - |
| isNumeric (T value, String name) | - |
| matchesPattern (Pattern pattern, T chars) | - |
| matchesPattern (Pattern pattern, T chars, String name) | - |
| noNullElements (T iterable) | - |
| noNullElements (T[] array) | - |
| noNullElements (T[] array, String name) | - |
| noNullElements (T iterable, String name) | - |
| notEmpty (boolean expression) | - |
| notEmpty (boolean expression, String name) | - |
| notEmpty (T chars) | - |
| notEmpty (T collection) | - |
| notEmpty (T map) | - |
| notEmpty (T[] array) | - |
| notEmpty (T[] array, String name) | - |
| notEmpty (T reference, boolean expression, String name) | - |
| notEmpty (T chars, String name) | - |
| notEmpty (T collection, String name) | - |
| notEmpty (T map, String name) | - |
| notNaN (double value) | - |
| notNaN (double value, String name) | - |
| notNaN (float value) | - |
| notNaN (float value, String name) | - |
| notNull (T reference) | checkNotNull (T reference) |
| notNull (T reference, String name) | checkNotNull (T reference, String message) |
| positionIndex (int index, int size) | checkPositionIndex (int index, int size) |
| range (int start, int end, int size) | checkPositionIndexes (int start, int end, int size) |
| stateIsTrue (boolean expression) | checkState (boolean expression) |
| stateIsTrue (boolean expression, Class<? extends RuntimeException> clazz) | - |
| stateIsTrue (boolean expression, String description) | checkState (boolean expression, String errorMessage) |
| stateIsTrue (boolean expression, String descriptionTemplate, Object... descriptionTemplateArgs) | checkState (boolean expression, String errorMessageTemplate, Object... errorMessageArgs) |
| Methods that are not directly supported by Check | |
| - | checkArgument (boolean expression) |
| - | checkArgument (boolean expression, Object errorMessage) |
| - | checkArgument (boolean expression, String errorMessageTemplate, Object... errorMessageArgs) |
| - | checkElementIndex (int index, int size) |
| - | checkElementIndex (int index, int size, String desc) |
| - | checkNotNull (T reference, String errorMessageTemplate, Object... errorMessageArgs) |
| - | checkPositionIndex (int index, int size, String desc) |
| Method of Check | Method of Validate |
|---|---|
| contains(Collection<T> haystack, T needle) | - |
| equals(T expected, T check) | - |
| hasAnnotation(Class<?> clazz, Class<? extends Annotation>annotation) | - |
| instanceOf(Class<?> type, Object obj) | isInstanceOf(Class<?> type, Object obj) |
| instanceOf(Class<?> type, Object obj, String message) | isInstanceOf(Class<?> type, Object obj, String message, Object... values) |
| isNumber (String value) | - |
| isNumber (String value, String name) | - |
| isNumeric (T value) | - |
| isNumeric (T value, String name) | - |
| matchesPattern (Pattern pattern, T chars) | matchesPattern (Pattern pattern, T chars) |
| matchesPattern (Pattern pattern, T chars, String name) | matchesPattern (Pattern pattern, T chars, String message, Object... values) |
| noNullElements (T iterable) | noNullElements (T iterable) |
| noNullElements (T[] array) | noNullElements (Object[] array) |
| noNullElements (T[] array, String name) | noNullElements (Object[] array, String message) |
| noNullElements (T iterable, String name) | noNullElements (T iterable, String name) |
| notEmpty (boolean expression) | - |
| notEmpty (boolean expression, String name) | - |
| notEmpty (T chars) | notEmpty (T chars) |
| notEmpty (T collection) | notEmpty (Collection collection, String message) |
| notEmpty (T map) | notEmpty (Map map) |
| notEmpty (T[] array) | notEmpty (Object[] array) |
| notEmpty (T[] array, String name) | notEmpty (Object[] array, String message) |
| notEmpty (T reference, boolean expression, String name) | - |
| notEmpty (T chars, String name) | notEmpty (T chars, String message, Object... values) |
| notEmpty (T collection, String name) | notEmpty (Collection collection, String message) |
| notEmpty (T map, String name) | notEmpty (Map map, String message) |
| notNaN (double value) | - |
| notNaN (double value, String name) | - |
| notNaN (float value) | - |
| notNaN (float value, String name) | - |
| notNull (T reference) | notNull (Object object) |
| notNull (T reference, String name) | notNull (Object object, String message) |
| positionIndex (int index, int size) | - |
| range (int start, int end, int size) | - |
| stateIsTrue (boolean expression) | validState (boolean expression) |
| stateIsTrue (boolean expression, Class<? extends RuntimeException> clazz) | - |
| stateIsTrue (boolean expression, String description) | - |
| stateIsTrue (boolean expression, String descriptionTemplate, Object... descriptionTemplateArgs) | validState (boolean expression, String message, Object... values) |
| Methods that are not directly supported by Check | |
| - | exclusiveBetween (T start, T end, Comparable<T> value) |
| - | exclusiveBetween (T start, T end, Comparable<T> value, String message, Object... values) |
| - | inclusiveBetween (T start, T end, Comparable<T> value) |
| - | inclusiveBetween (T start, T end, Comparable<T> value, String message, Object... values) |
| - | isAssignableFrom (Class superType, Class subType) |
| - | isAssignableFrom (Class superType, Class subType, String message, Object... values) |
| - | isTrue (boolean expression) |
| - | isTrue (boolean expression, String message, double value) |
| - | isTrue (boolean expression, String message, long value) |
| - | isTrue (boolean expression, String message, Object... values) |
| - | notBlank (T chars) |
| - | notBlank (T chars, String message, Object... values) |
| - | validIndex (T[] array, int index) |
| - | validIndex (T[] array, int index, String message, Object... values) |
| - | validIndex (T chars, int index) |
| - | validIndex (T chars, int index, String message, Object... values) |
| - | validIndex (T collection, int index) |
| - | validIndex (T collection, int index, String message, Object... values) |