Class OptionalMatchers


  • public final class OptionalMatchers
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> org.hamcrest.Matcher<java.util.Optional<T>> emptyOptional()
      Creates a Matcher that matches empty Optionals.
      static org.hamcrest.Matcher<java.util.Optional<?>> optionalWithValue()
      Creates a Matcher that matches any Optional with a value.
      static <T> org.hamcrest.Matcher<java.util.Optional<? extends T>> optionalWithValue​(org.hamcrest.Matcher<T> matcher)
      Creates a Matcher that matches an Optional with a value that matches the given Matcher.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • emptyOptional

        public static <T> org.hamcrest.Matcher<java.util.Optional<T>> emptyOptional()
        Creates a Matcher that matches empty Optionals.
      • optionalWithValue

        public static org.hamcrest.Matcher<java.util.Optional<?>> optionalWithValue()
        Creates a Matcher that matches any Optional with a value.
      • optionalWithValue

        public static <T> org.hamcrest.Matcher<java.util.Optional<? extends T>> optionalWithValue​(org.hamcrest.Matcher<T> matcher)
        Creates a Matcher that matches an Optional with a value that matches the given Matcher.