public class Verify extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Verify.ErrorLoader<K extends Throwable> |
| Constructor and Description |
|---|
Verify() |
| Modifier and Type | Method and Description |
|---|---|
static <K extends Throwable> |
checkCondition(boolean condition,
Verify.ErrorLoader<K> exception) |
static <T> boolean |
contains(T lookFor,
Collection<T> coll)
Checks if the collection contains the object if collection is not null.
|
static <T> boolean |
contains(T lookFor,
Map<T,Object> map) |
static <T> boolean |
contains(T lookFor,
java.util.stream.Stream<T> stream)
Checks if the stream contains the object.
|
static <T> boolean |
contains(T lookFor,
T... objects)
Checks if the array contains the object.
|
static boolean |
containsNull(Object... object) |
static <T,K> boolean |
equals(T object,
K object2) |
static boolean |
equalsIgnoreCase(String one,
String two) |
static boolean |
equalsOne(String toCheck,
String... isEqual) |
static File |
existCheck(File file) |
static <K extends Throwable> |
existCheck(File file,
Verify.ErrorLoader<K> exception) |
static boolean |
exists(File file)
Checks if the file exists if it is not null.
|
static boolean |
hasPermission(String permission,
ISender sender) |
static <T> boolean |
isEmpty(Collection<T> coll)
Checks if the given parameter is empty if it is not null.
|
static <T,K> boolean |
isEmpty(Map<T,K> map)
Checks if the given parameter is empty if it is not null.
|
static boolean |
isEmpty(String string)
Checks if the given parameter is empty if it is not null.
|
static boolean |
notNull(Object... object) |
static <T> T[] |
nullCheck(T... objects) |
static <T> T |
nullCheck(T object)
Checks if the given object is null, throws exception if null.
|
static <T,K extends Throwable> |
nullCheck(T object,
Verify.ErrorLoader<K> exception) |
static <T,K extends Throwable> |
nullCheck(Verify.ErrorLoader<K> exception,
T... objects) |
public static boolean exists(File file)
file - File to checkpublic static File existCheck(File file) throws IllegalArgumentException
IllegalArgumentExceptionpublic static <K extends Throwable> File existCheck(File file, Verify.ErrorLoader<K> exception) throws K extends Throwable
K extends Throwablepublic static boolean isEmpty(String string)
string - String.public static <T> boolean isEmpty(Collection<T> coll)
T - Object type variablecoll - Collectionpublic static <T,K> boolean isEmpty(Map<T,K> map)
T - Object type variableK - Object type variable, not checkedmap - Any map objectpublic static <T> boolean contains(T lookFor,
Collection<T> coll)
T - Object type variablelookFor - object to look forcoll - Collection to check the object forpublic static <T> boolean contains(T lookFor,
java.util.stream.Stream<T> stream)
T - Object type variablelookFor - object to look forstream - stream of objects@SafeVarargs public static <T> boolean contains(T lookFor, T... objects)
T - Object type variablelookFor - object to look forobjects - objectspublic static <T> boolean contains(T lookFor,
Map<T,Object> map)
T - lookFor - map - public static boolean equalsIgnoreCase(String one, String two)
one - two - public static <T,K> boolean equals(T object,
K object2)
T - K - object - object2 - public static boolean notNull(Object... object)
public static boolean containsNull(Object... object)
public static <T> T nullCheck(T object)
throws IllegalArgumentException
T - Object type variableobject - Object to checkNullPointerException - If the object is null.IllegalArgumentExceptionpublic static <T,K extends Throwable> T nullCheck(T object, Verify.ErrorLoader<K> exception) throws K extends Throwable
K extends Throwable@SafeVarargs public static <T> T[] nullCheck(T... objects) throws IllegalArgumentException
IllegalArgumentExceptionpublic static <T,K extends Throwable> T[] nullCheck(Verify.ErrorLoader<K> exception, T... objects) throws K extends Throwable
K extends Throwablepublic static <K extends Throwable> void checkCondition(boolean condition, Verify.ErrorLoader<K> exception) throws K extends Throwable
K extends ThrowableCopyright © 2018. All rights reserved.