Class AbstractEnumAssert<A extends AbstractEnumAssert<A,E>,E extends Enum<E>>

java.lang.Object
org.assertj.core.api.AbstractAssert<A,E>
io.github.ascopes.jct.assertions.AbstractEnumAssert<A,E>
Type Parameters:
A - the implementation type.
E - the enum type.
All Implemented Interfaces:
Assert<A,E>, Descriptable<A>, ExtensionPoints<A,E>
Direct Known Subclasses:
DiagnosticKindAssert, JavaFileObjectKindAssert

public abstract class AbstractEnumAssert<A extends AbstractEnumAssert<A,E>,E extends Enum<E>> extends AbstractAssert<A,E>
Abstract base class for an assertion on an Enum.
Since:
0.0.1
Author:
Ashley Scopes
  • Constructor Details

    • AbstractEnumAssert

      protected AbstractEnumAssert(@Nullable E value, Class<?> selfType)
      Initialize this enum assertion.
      Parameters:
      value - the value to assert upon.
      selfType - the type of this assertion implementation.
  • Method Details

    • isAnyOf

      @SafeVarargs public final A isAnyOf(E... elements)
      Assert that the value is one of the given values.
      Parameters:
      elements - the elements to check for.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if any of the elements to test against are null.
      IllegalArgumentException - if the elements array is empty.
      AssertionError - if the actual value is null, or if the value is not in the given group of acceptable values.
    • isAnyOfElements

      public final A isAnyOfElements(Collection<E> elements)
      Assert that the value is one of the given values.
      Parameters:
      elements - the elements to check for.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if any of the elements to test against are null.
      IllegalArgumentException - if the elements collection is empty.
      AssertionError - if the actual value is null, or if the value is not in the given iterable of acceptable values.
    • isNoneOf

      @SafeVarargs public final A isNoneOf(E... elements)
      Assert that the value is none of the given values.
      Parameters:
      elements - any elements to check for.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if any of the elements to test against are null.
      IllegalArgumentException - if the elements array is empty.
      AssertionError - if the actual value is null, or if the value is in the given group of acceptable values.
    • isNoneOfElements

      public final A isNoneOfElements(Collection<E> elements)
      Assert that the value is one of the given values.
      Parameters:
      elements - the elements to check for.
      Returns:
      this assertion object.
      Throws:
      NullPointerException - if any of the elements to test against are null.
      IllegalArgumentException - if the elements collection is empty.
      AssertionError - if the actual value is null, or if the value is in the given iterable of acceptable values.