Class Assertion

java.lang.Object
org.trustdeck.utils.Assertion

@Component public class Assertion extends Object
This class encapsulates utility functionalities.
Author:
Eric Wündisch and Armin Müller
  • Constructor Details

    • Assertion

      public Assertion()
  • Method Details

    • assertNotNullAll

      public static Boolean assertNotNullAll(Object... assertObjects)
      Method that checks whether any one of the given objects is not null.
      Parameters:
      assertObjects - a list of objects that should be checked
      Returns:
      true only if none of the passed objects are null, false otherwise.
    • assertNullAll

      public static Boolean assertNullAll(Object... assertObjects)
      Method that checks whether all of the given objects are null.
      Parameters:
      assertObjects - a list of objects that should be checked
      Returns:
      true only if all of the passed objects are null, false otherwise.
    • isNullOrEmpty

      public static boolean isNullOrEmpty(String value)
      Method that checks whether the given String is null or empty.
      Parameters:
      value - the String to check
      Returns:
      true only if the passed object is a string and null or empty, false otherwise.
    • isNullOrEmpty

      public static boolean isNullOrEmpty(String... values)
      Method that checks whether a list of given Strings is null or empty.
      Parameters:
      values - the String to check
      Returns:
      true only if the passed objects are strings and null or empty, false otherwise.
    • isNotNullOrEmpty

      public static boolean isNotNullOrEmpty(String value)
      Method that checks whether the given String is not null nor empty.
      Parameters:
      value - the String to check
      Returns:
      true only if the passed object is a string and neither null nor empty, false otherwise.
    • isNotNullOrEmpty

      public static boolean isNotNullOrEmpty(String... values)
      Method that checks whether a list of given Strings is not null nor empty.
      Parameters:
      values - the String to check
      Returns:
      true only if the passed objects are strings and neither null nor empty, false otherwise.
    • isJsonEmpty

      public static boolean isJsonEmpty(com.fasterxml.jackson.databind.JsonNode node)
      Helper method to check if a given JSON is empty.
      Parameters:
      node - the JSON to check
      Returns:
      true if the JSON is empty, false otherwise