java.lang.Object
com.github.hypfvieh.util.CompareUtil
- Autor:
- hypfvieh
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic booleanReturns true if the specified object equals at least one of the specified other objects.static <T> TifFalse(boolean _b, T _t) Returns the second parameter if the condition is false or null if the condition is true.static <T> TifTrue(boolean _b, T _t) Returns the second parameter if the condition is true or null if the condition is false.static StringisAnyFileMissing(File... _files) Checks if any of the passed in files are non-existing.static booleanChecks if any of the passed in objects is null.static booleanmapContainsKeys(Map<?, ?> _map, Object... _keys) Checks whether a map contains all of the specified keys.static booleanstartsWithAny(String _str, String... _startStrings) Checks if given String starts with any of the other given parameters.static voidthrowIfAnyNull(String _errMsg, Object... _objects) Throws aNullPointerExceptionif any of the given objects isnull.
-
Methodendetails
-
isAnyNull
Checks if any of the passed in objects is null.- Parameter:
_objects- array of objects, may be null- Gibt zurück:
- true if null found, false otherwise
-
throwIfAnyNull
Throws aNullPointerExceptionif any of the given objects isnull.- Parameter:
_errMsg-_objects-
-
isAnyFileMissing
Checks if any of the passed in files are non-existing.- Parameter:
_files- array of files- Gibt zurück:
- the filename of the missing file, otherwise returns null.
-
ifTrue
public static <T> T ifTrue(boolean _b, T _t) Returns the second parameter if the condition is true or null if the condition is false. Returns empty string instead of null for implementors ofCharSequence.- Parameter:
_b- condition_t- object- Gibt zurück:
- object or null
-
ifFalse
public static <T> T ifFalse(boolean _b, T _t) Returns the second parameter if the condition is false or null if the condition is true. Returns empty string instead of null for implementors ofCharSequence.- Parameter:
_b- condition_t- object- Gibt zurück:
- object or null
-
equalsOne
Returns true if the specified object equals at least one of the specified other objects.- Parameter:
_obj- object_arrObj- array of objects to compare to- Gibt zurück:
- true if equal, false otherwise or if either parameter is null
-
mapContainsKeys
Checks whether a map contains all of the specified keys.- Parameter:
_map- map_keys- one or more keys- Gibt zurück:
- true if all keys found in map, false otherwise
-
startsWithAny
Checks if given String starts with any of the other given parameters.- Parameter:
_str- string to check_startStrings- start strings to compare- Gibt zurück:
- true if any match, false otherwise
-