Class API.Match.Case0<T,R>

java.lang.Object
io.vavr.API.Match.Case0<T,R>
Type Parameters:
T - Type of the value being matched
R - Return value type
All Implemented Interfaces:
API.Match.Case<T,R>, Function1<T,R>, PartialFunction<T,R>, Serializable, Function<T,R>
Enclosing class:
API.Match<T>

public static final class API.Match.Case0<T,R> extends Object implements API.Match.Case<T,R>
API.Match.Case implementation for simplest case
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      The serial version UID for serialization.
      See Also:
    • pattern

      private final API.Match.Pattern0<T> pattern
    • f

      private final transient Function<? super T, ? extends R> f
  • Constructor Details

  • Method Details

    • apply

      public R apply(T obj)
      Description copied from interface: PartialFunction
      Applies this function to the given argument and returns the result.
      Specified by:
      apply in interface Function<T,R>
      Specified by:
      apply in interface Function1<T,R>
      Specified by:
      apply in interface PartialFunction<T,R>
      Parameters:
      obj - the input argument
      Returns:
      the result of applying this function to the input
    • isDefinedAt

      public boolean isDefinedAt(T obj)
      Description copied from interface: PartialFunction
      Tests whether a value is contained in the function's domain.
      Specified by:
      isDefinedAt in interface PartialFunction<T,R>
      Parameters:
      obj - a potential input to the function
      Returns:
      true if the given value is contained in the function's domain, false otherwise