Class InferenceResponse.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<InferenceResponse.Builder>
co.elastic.clients.elasticsearch.inference.InferenceResponse.Builder
- All Implemented Interfaces:
WithJson<InferenceResponse.Builder>,ObjectBuilder<InferenceResponse>
- Enclosing class:
- InferenceResponse
public static class InferenceResponse.Builder
extends WithJsonObjectBuilderBase<InferenceResponse.Builder>
implements ObjectBuilder<InferenceResponse>
Builder for
InferenceResponse.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aInferenceResponse.result(InferenceResult value) Required - Response value.result(InferenceResultVariant value) Required - Response value.Required - Response value.protected InferenceResponse.Builderself()withJson(jakarta.json.stream.JsonParser parser, JsonpMapper mapper) Sets additional properties values on this object by reading from a JSON input.Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
result
Required - Response value. -
result
public final InferenceResponse.Builder result(Function<InferenceResult.Builder, ObjectBuilder<InferenceResult>> fn) Required - Response value. -
result
Required - Response value. -
withJson
public InferenceResponse.Builder withJson(jakarta.json.stream.JsonParser parser, JsonpMapper mapper) Description copied from interface:WithJsonSets additional properties values on this object by reading from a JSON input.This is a "partial deserialization": properties that were already set keep their value if they're not present in the JSON input, and properties can also be set after having called this method, including overriding those read from the JSON input.
This low level variant of
withJsongives full control on the json parser and object mapper. Most of the time usingWithJson.withJson(Reader)andWithJson.withJson(InputStream)will be more convenient.- Specified by:
withJsonin interfaceWithJson<InferenceResponse.Builder>- Overrides:
withJsonin classWithJsonObjectBuilderBase<InferenceResponse.Builder>- Parameters:
parser- the JSONP parsermapper- the JSONP mapper used to deserialize values and nested objects- Returns:
- this object
-
self
- Specified by:
selfin classWithJsonObjectBuilderBase<InferenceResponse.Builder>
-
build
Builds aInferenceResponse.- Specified by:
buildin interfaceObjectBuilder<InferenceResponse>- Throws:
NullPointerException- if some of the required fields are null.
-