Class OptionalShouldContainInstanceOf

java.lang.Object
org.assertj.core.error.BasicErrorMessageFactory
org.assertj.core.error.OptionalShouldContainInstanceOf
All Implemented Interfaces:
ErrorMessageFactory

public class OptionalShouldContainInstanceOf extends BasicErrorMessageFactory
Build an error message when a value should be instance of a specific class.
Author:
Alban Dericbourg
  • Method Details

    • shouldContainInstanceOf

      public static OptionalShouldContainInstanceOf shouldContainInstanceOf(Object value, Class<?> clazz)
      Indicates that a value should be present in an empty Optional.
      Parameters:
      value - Optional to be checked.
      clazz - the class to check the optional value against
      Returns:
      an error message factory.
      Throws:
      NullPointerException - if optional is null.