public final class ProcessorUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getInputValueName(java.lang.String inputPrefix,
com.google.common.collect.BiMap<java.lang.String,java.lang.String> inputMapper,
java.lang.String field)
Calculate the name of the input value.
|
static java.lang.String |
getOutputValueName(java.lang.String outputPrefix,
java.util.Map<java.lang.String,java.lang.String> outputMapper,
java.lang.reflect.Field field)
Calculate the name of the output value.
|
static <In,Out> In |
populateInputParameter(Processor<In,Out> processor,
Values values)
Create the input object required by the processor and populate all the fields from the values object.
|
static void |
writeProcessorOutputToValues(java.lang.Object output,
Processor<?,?> processor,
Values values)
Read the values from the output object and write them to the values object.
|
public static <In,Out> In populateInputParameter(Processor<In,Out> processor, @Nonnull Values values)
Processor.createInputParameter() returns an instance of values then the values object will be returned.In - type of the processor input objectOut - type of the processor output objectprocessor - the processor that the input object will be for.values - the object containing the values to put into the input objectpublic static void writeProcessorOutputToValues(java.lang.Object output,
Processor<?,?> processor,
Values values)
output - the output object from a processorprocessor - the processor the output if fromvalues - the object for sharing values between processorspublic static java.lang.String getInputValueName(@Nullable
java.lang.String inputPrefix,
@Nonnull
com.google.common.collect.BiMap<java.lang.String,java.lang.String> inputMapper,
@Nonnull
java.lang.String field)
inputPrefix - a nullable prefix to prepend to the name if non-null and non-emptyinputMapper - the name mapperfield - the field containing the valuepublic static java.lang.String getOutputValueName(@Nullable
java.lang.String outputPrefix,
@Nonnull
java.util.Map<java.lang.String,java.lang.String> outputMapper,
@Nonnull
java.lang.reflect.Field field)
outputPrefix - a nullable prefix to prepend to the name if non-null and non-emptyoutputMapper - the name mapperfield - the field containing the value