Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.grpc.javads
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.grpc.javadsl.package.javaFunction")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.grpc.javadsl.package.japiFunction")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.grpc.internal.ScalaServerStreamingRequestBuilder.this")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.grpc.javadsl.package.scalaPartialFunction")
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,15 @@

package org.apache.pekko.grpc

import scala.annotation.nowarn

import org.apache.pekko

package object javadsl {

/**
* Helper for creating Scala partial functions from [[pekko.japi.function.Function]]
* instances.
*/
@deprecated("no longer needed since support for Scala 2.11 has been dropped", "1.2.0")
def scalaPartialFunction[A, B](f: pekko.japi.function.Function[A, B]): PartialFunction[A, B] = {
case a => f(a)
}

/**
* Helper for creating Scala anonymous partial functions from [[pekko.japi.function.Function]]
* instances.
*/
@nowarn("msg=deprecated")
def scalaAnonymousPartialFunction[A, B, C](
f: pekko.japi.function.Function[A, pekko.japi.function.Function[B, C]]): A => PartialFunction[B, C] =
a => scalaPartialFunction(f(a))
a => { case b => f(a)(b) }
}
Loading