public static boolean isAssertEnabled()
Return true if the VM runs with assertions enabled.
public static void requireContainsNoNullValue(String name, Collection<?> c)
NullPointerException
- if any item is null
public static void requireNotEmpty(String name, Collection<?> c)
IllegalArgumentException
- if empty
public static boolean isValidJavaPackageName(CharSequence name)
public static void assertValidJavaBinaryName(CharSequence name)
IllegalArgumentException
- if the name is not a binary name
public static void assertValidJavaBinaryNameNoArray(CharSequence name)
IllegalArgumentException
- if the name is not a binary name
public static void validateState(boolean condition, String failed)
public static void validateStringRange(CharSequence string, int startInclusive, int endExclusive)
IllegalArgumentException
- if [startInclusive,endExclusive[ is not a valid substring range for the given string
public static void assertValidStringRange(CharSequence string, int startInclusive, int endExclusive)
public static boolean isJavaIdentifier(CharSequence name)
Returns true if the charsequence is a valid java identifier.
name
- Name (non-null)
NullPointerException
- If the name is null
public static int requireOver1(String name, int value)
public static int requireNonNegative(String name, int value)
IllegalArgumentException
- If value < 0
public static int requireIndexNonNegative(String name, int value)
IndexOutOfBoundsException
- If value < 0
public static int requireInNonNegativeRange(String name, int value, int maxValue)
IndexOutOfBoundsException
- If value < 0 || value >= maxValue
public static int requireInPositiveRange(String name, int value, int maxValue)
IndexOutOfBoundsException
- If value < 1 || value >= maxValue
public static int requireInInclusiveRange(String name, int value, int minValue, int maxValue)
IndexOutOfBoundsException
- If value < minValue || value > maxValue
public static int requireInExclusiveRange(String name, int value, int minValue, int maxValue)
IndexOutOfBoundsException
- If value < minValue || value > maxValue
public static int requireInRange(String name, int value, int minValue, int maxValue, boolean inclusive)
public static RuntimeException mustBe(String name, Object value, String condition)
public static <E extends RuntimeException> E mustBe(String name, Object value, String condition, Function<String,E> exceptionMaker)
public static <T> @NonNull T requireParamNotNull(String paramName, T obj)
public static @NonNull AssertionError shouldNotReachHere(String message)
public static @NonNull AssertionError shouldNotReachHere(String message, Throwable cause)
public static @NonNull ContextedAssertionError contexted(AssertionError e)
public static @NonNull ContextedStackOverflowError contexted(StackOverflowError e)
public static @NonNull org.apache.commons.lang3.exception.ContextedRuntimeException contexted(RuntimeException e)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4