Interface TransformationFunction<I,O>
-
- Type Parameters:
I
- The input value type.O
- The output value type.
- 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 TransformationFunction<I,O>
Transforms data based onTransformationDefinition
.- Since:
- 4.1.0
- See Also:
TransformationDefinition.getFunction()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
setup(TransformationConfigurationContext context)
Allows retrieving parameters fromTransformationConfigurationContext
to set up for thetransform(TransformationExecutionContext)
method.O
transform(TransformationExecutionContext<I> context)
Performs the transformation.
-
-
-
Method Detail
-
setup
default void setup(TransformationConfigurationContext context) throws DataIntegrationException
Allows retrieving parameters fromTransformationConfigurationContext
to set up for thetransform(TransformationExecutionContext)
method.For each instance of this function, the method is invoked only once. It does nothing by default.
If an exception happens when setting up any transformation function, the whole data integration task will not be performed.
All transformation errors of a table mapping can be retrieved from
TableMappingResult.getErrorMessages()
.- Throws:
DataIntegrationException
- A transformation error with user-friendly content.- See Also:
TransformationDefinition.getParameterDefinitions()
-
transform
O transform(TransformationExecutionContext<I> context) throws DataIntegrationException
Performs the transformation.Iterated invocation based on the source data.
If an exception happens, any other transformation functions configured after the current one will be skipped. The data integration task will not be interrupted and the next source data will be processed.
All transformation errors of a table mapping can be retrieved from
TableMappingResult.getErrorMessages()
.- Throws:
DataIntegrationException
- A transformation error with user-friendly content.- See Also:
TransformationDefinition.getInputDefinition()
,TransformationDefinition.getOutputDefinition()
-
-