Package oshi.util

Class Util

java.lang.Object
oshi.util.Util

@ThreadSafe public final class Util extends Object
General utility methods
  • Method Details

    • sleep

      public static void sleep(long ms)
      Sleeps for the specified number of milliseconds.
      Parameters:
      ms - How long to sleep
    • wildcardMatch

      public static boolean wildcardMatch(String text, String pattern)
      Tests if a String matches another String with a wildcard pattern.
      Parameters:
      text - The String to test
      pattern - The String containing a wildcard pattern where ? represents a single character and * represents any number of characters. If the first character of the pattern is a carat (^) the test is performed against the remaining characters and the result of the test is the opposite.
      Returns:
      True if the String matches or if the first character is ^ and the remainder of the String does not match.
    • isBlank

      public static boolean isBlank(String s)
      Tests if a String is either null or empty.
      Parameters:
      s - The string to test
      Returns:
      True if the String is either null or empty.
    • isBlankOrUnknown

      public static boolean isBlankOrUnknown(String s)
      Tests if a String is either null or empty or the unknown constant.
      Parameters:
      s - The string to test
      Returns:
      True if the String is either null or empty or the unknown constant.