All Downloads are FREE. Search and download functionalities are using the official Maven repository.

akka.japi.pf.FI Maven / Gradle / Ivy

/*
 * Copyright (C) 2009-2020 Lightbend Inc. 
 */

package akka.japi.pf;

/**
 * Class that encapsulates Functional Interfaces used for creating partial functions.
 *
 * 

These classes are kept for compatibility, but for future API's please prefer the ones in * {@link akka.japi.function}. */ public final class FI { private FI() {} /** * Functional interface for an application. * *

This class is kept for compatibility, but for future API's please prefer {@link * akka.japi.function.Function}. * * @param the input type, that this Apply will be applied to * @param the return type, that the results of the application will have */ public static interface Apply { /** * The application to perform. * * @param i an instance that the application is performed on * @return the result of the application */ public R apply(I i) throws Exception; } /** * Functional interface for an application. * *

This class is kept for compatibility, but for future API's please prefer {@link * akka.japi.function.Function2}. * * @param the first input type, that this Apply will be applied to * @param the second input type, that this Apply will be applied to * @param the return type, that the results of the application will have */ public static interface Apply2 { /** * The application to perform. * * @param i1 an instance that the application is performed on * @param i2 an instance that the application is performed on * @return the result of the application */ public R apply(I1 i1, I2 i2) throws Exception; } /** * Functional interface for a predicate. * *

This class is kept for compatibility, but for future API's please prefer {@link * java.util.function.Predicate} or {@link akka.japi.function.Predicate}. * * @param the type that the predicate will operate on. */ public static interface TypedPredicate { /** * The predicate to evaluate. * * @param t an instance that the predicate is evaluated on. * @return the result of the predicate */ public boolean defined(T t); } /** * Functional interface for a predicate. * * @param the type that the predicate will operate on. * @param the type that the predicate will operate on. */ public static interface TypedPredicate2 { /** * The predicate to evaluate. * * @param t an instance that the predicate is evaluated on. * @param u an instance that the predicate is evaluated on. * @return the result of the predicate */ public boolean defined(T t, U u); } /** * Functional interface for an application. * *

This class is kept for compatibility, but for future API's please prefer {@link * akka.japi.function.Procedure}. * * @param the input type, that this Apply will be applied to */ public static interface UnitApply { /** * The application to perform. * * @param i an instance that the application is performed on */ public void apply(I i) throws Exception; } /** * Functional interface for an application. * * @param the first input type, that this Apply will be applied to * @param the second input type, that this Apply will be applied to */ public static interface UnitApply2 { /** * The application to perform. * * @param i1 an instance that the application is performed on * @param i2 an instance that the application is performed on */ public void apply(I1 i1, I2 i2) throws Exception; } /** * Functional interface for an application. * * @param the first input type, that this Apply will be applied to * @param the second input type, that this Apply will be applied to * @param the third input type, that this Apply will be applied to */ public static interface UnitApply3 { /** * The application to perform. * * @param i1 an instance that the application is performed on * @param i2 an instance that the application is performed on * @param i3 an instance that the application is performed on */ public void apply(I1 i1, I2 i2, I3 i3) throws Exception; } /** * Functional interface for an application. * * @param the first input type, that this Apply will be applied to * @param the second input type, that this Apply will be applied to * @param the third input type, that this Apply will be applied to * @param the fourth input type, that this Apply will be applied to */ public static interface UnitApply4 { /** * The application to perform. * * @param i1 an instance that the application is performed on * @param i2 an instance that the application is performed on * @param i3 an instance that the application is performed on * @param i4 an instance that the application is performed on */ public void apply(I1 i1, I2 i2, I3 i3, I4 i4) throws Exception; } /** * Functional interface for an application. * *

This class is kept for compatibility, but for future API's please prefer {@link * akka.japi.function.Effect}. */ public static interface UnitApplyVoid { /** The application to perform. */ public void apply() throws Exception; } /** * Package scoped functional interface for a predicate. Used internally to match against arbitrary * types. * *

This class is kept for compatibility, but for future API's please prefer {@link * java.util.function.Predicate} or {@link akka.japi.function.Predicate}. */ static interface Predicate { /** * The predicate to evaluate. * * @param o an instance that the predicate is evaluated on. * @return the result of the predicate */ public boolean defined(Object o); } }