Packages

c

scala.jdk.FunctionWrappers

FromJavaFunction

case class FromJavaFunction[T, R](jf: java.util.function.Function[T, R]) extends (T) => R with Product with Serializable

Source
FunctionWrappers.scala
Linear Supertypes
java.io.Serializable, Product, Equals, (T) => R, AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FromJavaFunction
  2. Serializable
  3. Product
  4. Equals
  5. Function1
  6. AnyRef
  7. Any
Implicitly
  1. by UnliftOps
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FromJavaFunction(jf: java.util.function.Function[T, R])

Value Members

  1. def andThen[A](g: (R) => A): (T) => A

    Composes two instances of Function1 in a new Function1, with this function applied first.

    Composes two instances of Function1 in a new Function1, with this function applied first.

    A

    the result type of function g

    g

    a function R => A

    returns

    a new function f such that f(x) == g(apply(x))

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  2. def apply(x1: T): R

    Apply the body of this function to the argument.

    Apply the body of this function to the argument.

    returns

    the result of function application.

    Definition Classes
    FromJavaFunctionFunction1
  3. def compose[A](g: (A) => T): (A) => R

    Composes two instances of Function1 in a new Function1, with this function applied last.

    Composes two instances of Function1 in a new Function1, with this function applied last.

    A

    the type to which function g can be applied

    g

    a function A => T1

    returns

    a new function f such that f(x) == apply(g(x))

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  4. val jf: java.util.function.Function[T, R]
  5. def productElementNames: Iterator[String]

    An iterator over the names of all the elements of this product.

    An iterator over the names of all the elements of this product.

    Definition Classes
    Product
  6. def toString(): String

    Creates a String representation of this object.

    Creates a String representation of this object. The default representation is platform dependent. On the java platform it is the concatenation of the class name, "@", and the object's hashcode in hexadecimal.

    returns

    a String representation of the object.

    Definition Classes
    Function1 → AnyRef → Any
  7. def unlift: PartialFunction[T, B]

    Converts an optional function to a partial function.

    Converts an optional function to a partial function.

    Implicit
    This member is added by an implicit conversion from FromJavaFunction[T, R] toUnliftOps[T, B] performed by method UnliftOps in scala.Function1.This conversion will take place only if R is a subclass of Option[B] (R <: Option[B]).
    Definition Classes
    UnliftOps
    Example:
    1. Unlike Function.unlift, this UnliftOps.unlift method can be used in extractors.

      val of: Int => Option[String] = { i =>
        if (i == 2) {
          Some("matched by an optional function")
        } else {
          None
        }
      }
      
      util.Random.nextInt(4) match {
        case of.unlift(m) => // Convert an optional function to a pattern
          println(m)
        case _ =>
          println("Not matched")
      }