Packages

object Filter

Java API (not recommended): Callback for the Future.filter operation that creates a new Future which will conditionally contain the success of another Future.

Unfortunately it is not possible to express the type of a Scala filter in Java: Function1[T, Boolean], where “Boolean” is the primitive type. It is possible to use Future.filter by constructing such a function indirectly:

import static akka.dispatch.Filter.filterOf;
Future<String> f = ...;
f.filter(filterOf(new Function<String, Boolean>() {
  @Override
  public Boolean apply(String s) {
    ...
  }
}));

However, Future.filter exists mainly to support Scala’s for-comprehensions, thus Java users should prefer Future.map, translating non-matching values to failure cases.

Source
Future.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Filter
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def filterOf[T](f: Function[T, Boolean]): (T) ⇒ Boolean