Package io.vavr

Class API.Match.Case1<T,​T1,​R>

  • Type Parameters:
    T - Type of the value being matched
    T1 - Intermediate type 1
    R - Return value type
    All Implemented Interfaces:
    API.Match.Case<T,​R>, Function1<T,​R>, PartialFunction<T,​R>, java.io.Serializable, java.util.function.Function<T,​R>
    Enclosing class:
    API.Match<T>

    public static final class API.Match.Case1<T,​T1,​R>
    extends java.lang.Object
    implements API.Match.Case<T,​R>
    API.Match.Case implementation for a case with 1 intermediate type
    See Also:
    Serialized Form
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        The serial version UID for serialization.
        See Also:
        Constant Field Values
      • f

        private final transient java.util.function.Function<? super T1,​? extends R> f
    • Constructor Detail

      • Case1

        private Case1​(API.Match.Pattern1<T,​T1> pattern,
                      java.util.function.Function<? super T1,​? extends R> f)
    • Method Detail

      • 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 java.util.function.Function<T,​T1>
        Specified by:
        apply in interface Function1<T,​T1>
        Specified by:
        apply in interface PartialFunction<T,​T1>
        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,​T1>
        Parameters:
        obj - a potential input to the function
        Returns:
        true if the given value is contained in the function's domain, false otherwise