Klasse CompareUtil

java.lang.Object
com.github.hypfvieh.util.CompareUtil

public class CompareUtil extends Object
Autor:
hypfvieh
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    static boolean
    equalsOne(Object _obj, Object... _arrObj)
    Returns true if the specified object equals at least one of the specified other objects.
    static <T> T
    ifFalse(boolean _b, T _t)
    Returns the second parameter if the condition is false or null if the condition is true.
    static <T> T
    ifTrue(boolean _b, T _t)
    Returns the second parameter if the condition is true or null if the condition is false.
    static String
    Checks if any of the passed in files are non-existing.
    static boolean
    isAnyNull(Object... _objects)
    Checks if any of the passed in objects is null.
    static boolean
    mapContainsKeys(Map<?,?> _map, Object... _keys)
    Checks whether a map contains all of the specified keys.
    static boolean
    startsWithAny(String _str, String... _startStrings)
    Checks if given String starts with any of the other given parameters.
    static void
    throwIfAnyNull(String _errMsg, Object... _objects)
    Throws a NullPointerException if any of the given objects is null.

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Methodendetails

    • isAnyNull

      public static boolean isAnyNull(Object... _objects)
      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

      public static void throwIfAnyNull(String _errMsg, Object... _objects)
      Throws a NullPointerException if any of the given objects is null.
      Parameter:
      _errMsg -
      _objects -
    • isAnyFileMissing

      public static String isAnyFileMissing(File... _files)
      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 of CharSequence.
      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 of CharSequence.
      Parameter:
      _b - condition
      _t - object
      Gibt zurück:
      object or null
    • equalsOne

      public static boolean equalsOne(Object _obj, Object... _arrObj)
      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

      public static boolean mapContainsKeys(Map<?,?> _map, Object... _keys)
      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

      public static boolean startsWithAny(String _str, String... _startStrings)
      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