Packages

package japi

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Package Members

  1. package function
  2. package pf
  3. package tuple

Type Members

  1. trait Creator[T] extends Serializable

    A constructor/factory, takes no parameters but creates a new value of type T every call.

    A constructor/factory, takes no parameters but creates a new value of type T every call.

    This class is kept for compatibility, but for future API's please prefer pekko.japi.function.Creator.

    Annotations
    @nowarn() @SerialVersionUID() @FunctionalInterface()
  2. trait Effect extends AnyRef

    An executable piece of code that takes no parameters and doesn't return any value.

    An executable piece of code that takes no parameters and doesn't return any value.

    This class is kept for compatibility, but for future API's please prefer pekko.japi.function.Effect.

    Annotations
    @FunctionalInterface()
  3. trait Function[T, R] extends AnyRef

    A Function interface.

    A Function interface. Used to create first-class-functions is Java.

    This class is kept for compatibility, but for future API's please prefer pekko.japi.function.Function.

    Annotations
    @FunctionalInterface()
  4. trait Function2[T1, T2, R] extends AnyRef

    A Function interface.

    A Function interface. Used to create 2-arg first-class-functions is Java.

    This class is kept for compatibility, but for future API's please prefer pekko.japi.function.Function2.

    Annotations
    @FunctionalInterface()
  5. abstract class JavaPartialFunction[A, B] extends AbstractPartialFunction[A, B]

    Helper for implementing a *pure* partial function: it will possibly be invoked multiple times for a single “application”, because its only abstract method is used for both isDefinedAt() and apply(); the former is mapped to isCheck == true and the latter to isCheck == false for those cases where this is important to know.

    Helper for implementing a *pure* partial function: it will possibly be invoked multiple times for a single “application”, because its only abstract method is used for both isDefinedAt() and apply(); the former is mapped to isCheck == true and the latter to isCheck == false for those cases where this is important to know.

    Failure to match is signaled by throwing noMatch(), i.e. not returning normally (the exception used in this case is pre-allocated, hence not that expensive).

    new JavaPartialFunction<Object, String>() {
      public String apply(Object in, boolean isCheck) {
        if (in instanceof TheThing) {
          if (isCheck) return null; // to spare the expensive or side-effecting code
          return doSomethingWithTheThing((TheThing) in);
        } else {
          throw noMatch();
        }
      }
    }

    The typical use of partial functions from Apache Pekko looks like the following:

    if (pf.isDefinedAt(x)) {
      pf.apply(x);
    }

    i.e. it will first call JavaPartialFunction.apply(x, true) and if that does not throw noMatch() it will continue with calling JavaPartialFunction.apply(x, false).

  6. sealed abstract class Option[A] extends Iterable[A]

    This class represents optional values.

    This class represents optional values. Instances of Option are either instances of case class Some or it is case object None.

  7. case class Pair[A, B](first: A, second: B) extends Product with Serializable

    Java API Represents a pair (tuple) of two elements.

    Java API Represents a pair (tuple) of two elements.

    Additional tuple types for 3 to 22 values are defined in the org.apache.pekko.japi.tuple package, e.g. pekko.japi.tuple.Tuple3.

    Annotations
    @SerialVersionUID()
  8. trait Predicate[T] extends AnyRef

    Java API: Defines a criteria and determines whether the parameter meets this criteria.

    Java API: Defines a criteria and determines whether the parameter meets this criteria.

    This class is kept for compatibility, but for future API's please prefer java.util.function.Predicate.

    Annotations
    @FunctionalInterface()
  9. trait Procedure[T] extends AnyRef

    A Procedure is like a Function, but it doesn't produce a return value.

    A Procedure is like a Function, but it doesn't produce a return value.

    This class is kept for compatibility, but for future API's please prefer pekko.japi.function.Procedure.

    Annotations
    @FunctionalInterface()

Deprecated Type Members

  1. class JAPI extends AnyRef
    Annotations
    @Deprecated
    Deprecated

Value Members

  1. object JavaPartialFunction
  2. object Option
  3. object Pair extends Serializable
  4. object Throwables

    Helper class for determining whether a Throwable is fatal or not.

    Helper class for determining whether a Throwable is fatal or not. User should only catch the non-fatal one,and keep rethrow the fatal one.

    Fatal errors are errors like VirtualMachineError (for example, OutOfMemoryError and StackOverflowError, subclasses of VirtualMachineError), ThreadDeath, LinkageError, InterruptedException, ControlThrowable.

    Note. this helper keep the same semantic with NonFatal in Scala. For example, all harmless Throwables can be caught by:

    try {
      // dangerous stuff
    } catch(Throwable e) {
      if (Throwables.isNonFatal(e)){
        log.error(e, "Something not that bad.");
      } else {
        throw e;
      }
  5. object Util

    This class hold common utilities for Java

Ungrouped