Class Utils

java.lang.Object
org.metricshub.ipmi.client.Utils

public class Utils extends Object
  • Field Details

  • Method Details

    • isBlank

      public static boolean isBlank(String value)
      Parameters:
      value - The value to check
      Returns:
      whether the value is null, empty or contains only blank chars
    • isNotBlank

      public static boolean isNotBlank(String value)
      Parameters:
      value - The value to check
      Returns:
      whether the value is not null, nor empty nor contains only blank chars
    • isEmpty

      public static boolean isEmpty(String value)
      Parameters:
      value - The value to check
      Returns:
      whether the value is empty of non-blank chars
      Throws:
      NullPointerException - if value is null
    • getValueOrEmpty

      public static String getValueOrEmpty(String value)
      Parameters:
      value - The value to return
      Returns:
      the given value or empty string if the value is null or empty
    • execute

      public static <T> T execute(AbstractIpmiRunner<T> callable, long timeout) throws InterruptedException, ExecutionException, TimeoutException
      Run the given Callable using the passed timeout in seconds.
      Type Parameters:
      T -
      Parameters:
      callable -
      timeout -
      Returns:
      Utils result returned by the callable
      Throws:
      InterruptedException
      ExecutionException
      TimeoutException