public class BinaryResponseProcessor<T extends Output<T>> extends Object implements ResponseProcessor<T>
ResponseProcessor
that takes a single value of the
field as the positive class and all other values as the negative
class.Constructor and Description |
---|
BinaryResponseProcessor(String fieldName,
String positiveResponse,
OutputFactory<T> outputFactory)
Constructs a binary response processor which emits a positive value for a single string
and a negative value for all other field values.
|
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 BinaryResponseProcessor(String fieldName, String positiveResponse, OutputFactory<T> outputFactory)
fieldName
- The field name to read.positiveResponse
- The positive response to look for.outputFactory
- The output factory to use.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>>
@Deprecated public void setFieldName(String fieldName)
setFieldName
in interface ResponseProcessor<T extends Output<T>>
fieldName
- The field name.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.