Class NullMatcher<T>

Type Parameters:
T - The type of the matched entity.
All Implemented Interfaces:
ElementMatcher<T>, ElementMatcher.Junction<T>

@Enhance public class NullMatcher<T> extends ElementMatcher.Junction.AbstractBase<T>
An element matcher that matches the null value.
  • Field Details

    • INSTANCE

      private static final NullMatcher<?> INSTANCE
      An instance of this matcher.
  • Constructor Details

    • NullMatcher

      public NullMatcher()
  • Method Details

    • make

      public static <T> ElementMatcher.Junction<T> make()
      Returns a matcher that only matches null.
      Type Parameters:
      T - The type of the matched entity.
      Returns:
      A matcher that only matches null.
    • matches

      public boolean matches(@MaybeNull T target)
      Matches a target against this element matcher.
      Parameters:
      target - The instance to be matched or null.
      Returns:
      true if the given element is matched by this matcher or false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object