Interface Match<T>

Type Parameters:
T - the type of the matched object
All Superinterfaces:
Comparable<Match<T>>

public interface Match<T> extends Comparable<Match<T>>

A match represents a match of an object matcher.

  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    compareTo(Match<T> other)
     
    static <T> Match<T>
    match(T object, boolean positive)
    Returns a simple match with the given object and binary state.
    boolean
    Returns if this match is a positive match.
    default boolean
    Returns if this match is a negative match.
    static <T> Match<T>
    negative(T object)
    Returns a negative match with the given object.
    Returns the matched object.
    static <T> Match<T>
    positive(T object)
    Returns a positive match with the given object.
  • Method Details

    • match

      static <T> Match<T> match(T object, boolean positive)

      Returns a simple match with the given object and binary state.

      Type Parameters:
      T - the type of the object
      Parameters:
      object - the object
      positive - if the match is positive
      Returns:
      the match
    • negative

      static <T> Match<T> negative(T object)

      Returns a negative match with the given object.

      Type Parameters:
      T - the type of the object
      Parameters:
      object - the object
      Returns:
      the match
    • positive

      static <T> Match<T> positive(T object)

      Returns a positive match with the given object.

      Type Parameters:
      T - the type of the object
      Parameters:
      object - the object
      Returns:
      the match
    • compareTo

      default int compareTo(Match<T> other)
      Specified by:
      compareTo in interface Comparable<T>
    • matched

      boolean matched()

      Returns if this match is a positive match.

      Returns:
      if this match is a positive match
    • negative

      default boolean negative()

      Returns if this match is a negative match.

      Returns:
      if this match is a negative match
    • object

      T object()

      Returns the matched object.

      Returns:
      the matched object