trait Function2[-T1, -T2, +R] extends Serializable
A Function interface. Used to create 2-arg first-class-functions is Java.
Serializable is needed to be able to grab line number for Java 8 lambdas.
Supports throwing Exception in the apply, which the java.util.function.BiFunction counterpart does not.
- Annotations
- @nowarn() @SerialVersionUID() @FunctionalInterface()
- Source
- Function.scala
- Alphabetic
- By Inheritance
- Function2
- Serializable
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def apply(arg1: T1, arg2: T2): R
- Annotations
- @throws(classOf[Exception])
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Function2[T1, T2, R], B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def andThen[V](g: Function[R, V]): Function2[T1, T2, V]
Compose this function with another function
g, such that the resulting function is equivalent tog(this(x1, x2)).Compose this function with another function
g, such that the resulting function is equivalent tog(this(x1, x2)). This creates a composed function that first applies this function to its arguments, and then applies functiongto the result.- Since
2.0.0
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def ensuring(cond: (Function2[T1, T2, R]) => Boolean, msg: => Any): Function2[T1, T2, R]
- def ensuring(cond: (Function2[T1, T2, R]) => Boolean): Function2[T1, T2, R]
- def ensuring(cond: Boolean, msg: => Any): Function2[T1, T2, R]
- def ensuring(cond: Boolean): Function2[T1, T2, R]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from Function2[T1, T2, R] toStringFormat[Function2[T1, T2, R]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)instead ofvalue.formatted(formatString), or use thef""string interpolator. In Java 15 and later,formattedresolves to the new method in String which has reversed parameters.
- def →[B](y: B): (Function2[T1, T2, R], B)
- Implicit
- This member is added by an implicit conversion from Function2[T1, T2, R] toArrowAssoc[Function2[T1, T2, R]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.