Class BooleanMatcher<T>

    • Field Detail

      • TRUE

        private static final BooleanMatcher<?> TRUE
        A matcher that always returns true.
      • FALSE

        private static final BooleanMatcher<?> FALSE
        A matcher that always returns false.
      • matches

        private final boolean matches
        The predefined result.
    • Constructor Detail

      • BooleanMatcher

        public BooleanMatcher​(boolean matches)
        Creates a new boolean element matcher.
        Parameters:
        matches - The predefined result.
    • Method Detail

      • of

        public static <T> ElementMatcher.Junction<T> of​(boolean matches)
        Returns an element matcher that returns the provided result.
        Type Parameters:
        T - The type of the matched entity.
        Parameters:
        matches - A matcher that always matches or never matches.
        Returns:
        A matcher that returns the provided result for all inputs.
      • matches

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object