aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/scala/spark/api/java/function/WrappedFunction2.scala
blob: 2c6e9b157181b5b540c3116ed815706cf2d98d4f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package spark.api.java.function

import scala.runtime.AbstractFunction2

/**
 * Subclass of Function2 for ease of calling from Java. The main thing it does is re-expose the
 * apply() method as call() and declare that it can throw Exception (since AbstractFunction2.apply
 * isn't marked to allow that).
 */
private[spark] abstract class WrappedFunction2[T1, T2, R] extends AbstractFunction2[T1, T2, R] {
  @throws(classOf[Exception])
  def call(t1: T1, t2: T2): R

  final def apply(t1: T1, t2: T2): R = call(t1, t2)
}