Class Conditions

java.lang.Object
org.fest.assertions.internal.Conditions

public class Conditions extends Object
Verifies that a value satisfies a Condition.
Author:
Alex Ruiz
  • Method Details

    • instance

      public static Conditions instance()
      Returns the singleton instance of this class.
      Returns:
      the singleton instance of this class.
    • assertIs

      public <T> void assertIs(AssertionInfo info, T actual, Condition<? super T> condition)
      Asserts that the actual value satisfies the given Condition.
      Type Parameters:
      T - the type of the actual value and the type of values that given Condition takes.
      Parameters:
      info - contains information about the assertion.
      actual - the actual value.
      condition - the given Condition.
      Throws:
      NullPointerException - if the given Condition is null.
      AssertionError - if the actual value does not satisfy the given Condition.
    • assertIsNot

      public <T> void assertIsNot(AssertionInfo info, T actual, Condition<? super T> condition)
      Asserts that the actual value does not satisfy the given Condition.
      Type Parameters:
      T - the type of the actual value and the type of values that given Condition takes.
      Parameters:
      info - contains information about the assertion.
      actual - the actual value.
      condition - the given Condition.
      Throws:
      NullPointerException - if the given Condition is null.
      AssertionError - if the actual value satisfies the given Condition.
    • assertHas

      public <T> void assertHas(AssertionInfo info, T actual, Condition<? super T> condition)
      Asserts that the actual value satisfies the given Condition.
      Type Parameters:
      T - the type of the actual value and the type of values that given Condition takes.
      Parameters:
      info - contains information about the assertion.
      actual - the actual value.
      condition - the given Condition.
      Throws:
      NullPointerException - if the given Condition is null.
      AssertionError - if the actual value does not satisfy the given Condition.
    • assertDoesNotHave

      public <T> void assertDoesNotHave(AssertionInfo info, T actual, Condition<? super T> condition)
      Asserts that the actual value does not satisfy the given Condition.
      Type Parameters:
      T - the type of the actual value and the type of values that given Condition takes.
      Parameters:
      info - contains information about the assertion.
      actual - the actual value.
      condition - the given Condition.
      Throws:
      NullPointerException - if the given Condition is null.
      AssertionError - if the actual value satisfies the given Condition.
    • assertIsNotNull

      public void assertIsNotNull(Condition<?> condition)
      Asserts the the given Condition is not null.
      Parameters:
      condition - the given Condition.
      Throws:
      NullPointerException - if the given Condition is null.