Class Assert

java.lang.Object
org.knowm.xchange.utils.Assert

public abstract class Assert
extends Object
Abstract class to provide the following to framework:
  • Provision of useful assertions to trap programmer errors early
  • Constructor Details

    • Assert

      public Assert()
  • Method Details

    • isTrue

      public static void isTrue​(boolean condition, String message)
      Asserts that a condition is true
      Parameters:
      condition - The condition under test
      message - The message for any exception
    • notNull

      public static void notNull​(Object object, String message)
      Asserts that an object is not null
      Parameters:
      object - The object under test
      message - The message for any exception
    • hasLength

      public static void hasLength​(String input, int length, String message)
      Asserts that a String is not null and of a certain length
      Parameters:
      input - The input under test
      message - The message for any exception
    • hasSize

      public static void hasSize​(Collection<?> input, int length, String message)
      Asserts that a Collection is not null and of a certain size
      Parameters:
      input - The input under test
      message - The message for any exception