Interface ProcessFunction<InputT,OutputT>
-
- Type Parameters:
InputT
- input value typeOutputT
- output value type
- All Superinterfaces:
java.io.Serializable
- All Known Subinterfaces:
SerializableFunction<InputT,OutputT>
- All Known Implementing Classes:
InferableFunction
,PAssert.MatcherCheckerFn
,SimpleFunction
,WithFailures.ExceptionAsMapHandler
,WithFailures.ThrowableHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ProcessFunction<InputT,OutputT> extends java.io.Serializable
A function that computes an output value of typeOutputT
from an input value of typeInputT
and isSerializable
.This is the most general function type provided in this SDK, allowing arbitrary
Exception
s to be thrown, and matching Java's expectations of a functional interface that can be supplied as a lambda expression or method reference. It is namedProcessFunction
because it is particularly appropriate anywhere a user needs to provide code that will eventually be executed as part of aDoFn
ProcessElement
function, which is allowed to declare throwingException
. If you need to execute user code in a context where arbitrary checked exceptions should not be allowed, require that users implement the subinterfaceSerializableFunction
instead.For more robust
Coder
inference, consider extendingInferableFunction
rather than implementing this interface directly.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OutputT
apply(InputT input)
Returns the result of invoking this function on the given input.
-