public class FieldResponseProcessor<T extends Output<T>> extends Object implements ResponseProcessor<T>
Constructor and Description |
---|
FieldResponseProcessor(String fieldName,
String defaultValue,
OutputFactory<T> outputFactory)
Constructs a response processor which passes the field value through the
output factory.
|
Modifier and Type | Method and Description |
---|---|
String |
getFieldName()
Gets the field name this ResponseProcessor uses.
|
OutputFactory<T> |
getOutputFactory()
Gets the OutputFactory this ResponseProcessor uses.
|
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance |
getProvenance() |
Optional<T> |
process(String value)
Returns Optional.empty() if it failed to process out a response.
|
void |
setFieldName(String fieldName)
Deprecated.
|
String |
toString() |
public FieldResponseProcessor(String fieldName, String defaultValue, OutputFactory<T> outputFactory)
fieldName
- The field to read.defaultValue
- The default value to extract if it's not found.outputFactory
- The output factory to use.@Deprecated public void setFieldName(String fieldName)
setFieldName
in interface ResponseProcessor<T extends Output<T>>
fieldName
- The field name.public OutputFactory<T> getOutputFactory()
ResponseProcessor
getOutputFactory
in interface ResponseProcessor<T extends Output<T>>
public String getFieldName()
ResponseProcessor
getFieldName
in interface ResponseProcessor<T extends Output<T>>
public Optional<T> process(String value)
ResponseProcessor
process
in interface ResponseProcessor<T extends Output<T>>
value
- The value to process.public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.