Class Utils

java.lang.Object
org.broadinstitute.http.nio.utils.Utils

public class Utils extends Object
Generic utility methods.
  • Constructor Details

    • Utils

      private Utils()
  • Method Details

    • nonNull

      public static <T> T nonNull(T o, Supplier<String> msg)
      Throws an IllegalArgumentException if the object is null.
      Type Parameters:
      T - type of the object.
      Parameters:
      o - object to test.
      msg - message for the exception.
      Returns:
      the same object if not null.
      Throws:
      IllegalArgumentException - if the object is null.
    • validateArg

      public static void validateArg(boolean condition, String msg)
      Parameters:
      condition - throw an Illegal argument exception if !condition
      msg - the error message when the condition is not met