Class Predict.PredictRequest.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<Predict.PredictRequest.Builder>
com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
tensorflow.serving.Predict.PredictRequest.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable, Predict.PredictRequestOrBuilder
Enclosing class:
Predict.PredictRequest

public static final class Predict.PredictRequest.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder> implements Predict.PredictRequestOrBuilder
 PredictRequest specifies which TensorFlow model to run, as well as
 how inputs are mapped to tensors and how outputs are filtered before
 returning to user.
 
Protobuf type tensorflow.serving.PredictRequest
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
    • internalGetMutableMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
      Overrides:
      internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
    • getDefaultInstanceForType

      public Predict.PredictRequest getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public Predict.PredictRequest build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public Predict.PredictRequest buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
    • setField

      public Predict.PredictRequest.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
    • clearField

      public Predict.PredictRequest.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
    • clearOneof

      public Predict.PredictRequest.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
    • setRepeatedField

      public Predict.PredictRequest.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
    • addRepeatedField

      public Predict.PredictRequest.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
    • mergeFrom

      public Predict.PredictRequest.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Predict.PredictRequest.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
    • mergeFrom

      public Predict.PredictRequest.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Predict.PredictRequest.Builder>
      Throws:
      IOException
    • hasModelSpec

      public boolean hasModelSpec()
       Model Specification. If version is not specified, will use the latest
       (numerical) version.
       
      .tensorflow.serving.ModelSpec model_spec = 1;
      Specified by:
      hasModelSpec in interface Predict.PredictRequestOrBuilder
      Returns:
      Whether the modelSpec field is set.
    • getModelSpec

      public Model.ModelSpec getModelSpec()
       Model Specification. If version is not specified, will use the latest
       (numerical) version.
       
      .tensorflow.serving.ModelSpec model_spec = 1;
      Specified by:
      getModelSpec in interface Predict.PredictRequestOrBuilder
      Returns:
      The modelSpec.
    • setModelSpec

      public Predict.PredictRequest.Builder setModelSpec(Model.ModelSpec value)
       Model Specification. If version is not specified, will use the latest
       (numerical) version.
       
      .tensorflow.serving.ModelSpec model_spec = 1;
    • setModelSpec

      public Predict.PredictRequest.Builder setModelSpec(Model.ModelSpec.Builder builderForValue)
       Model Specification. If version is not specified, will use the latest
       (numerical) version.
       
      .tensorflow.serving.ModelSpec model_spec = 1;
    • mergeModelSpec

      public Predict.PredictRequest.Builder mergeModelSpec(Model.ModelSpec value)
       Model Specification. If version is not specified, will use the latest
       (numerical) version.
       
      .tensorflow.serving.ModelSpec model_spec = 1;
    • clearModelSpec

      public Predict.PredictRequest.Builder clearModelSpec()
       Model Specification. If version is not specified, will use the latest
       (numerical) version.
       
      .tensorflow.serving.ModelSpec model_spec = 1;
    • getModelSpecBuilder

      public Model.ModelSpec.Builder getModelSpecBuilder()
       Model Specification. If version is not specified, will use the latest
       (numerical) version.
       
      .tensorflow.serving.ModelSpec model_spec = 1;
    • getModelSpecOrBuilder

      public Model.ModelSpecOrBuilder getModelSpecOrBuilder()
       Model Specification. If version is not specified, will use the latest
       (numerical) version.
       
      .tensorflow.serving.ModelSpec model_spec = 1;
      Specified by:
      getModelSpecOrBuilder in interface Predict.PredictRequestOrBuilder
    • getInputsCount

      public int getInputsCount()
      Description copied from interface: Predict.PredictRequestOrBuilder
       Input tensors.
       Names of input tensor are alias names. The mapping from aliases to real
       input tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'inputs' field.
       
      map<string, .tensorflow.TensorProto> inputs = 2;
      Specified by:
      getInputsCount in interface Predict.PredictRequestOrBuilder
    • containsInputs

      public boolean containsInputs(String key)
       Input tensors.
       Names of input tensor are alias names. The mapping from aliases to real
       input tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'inputs' field.
       
      map<string, .tensorflow.TensorProto> inputs = 2;
      Specified by:
      containsInputs in interface Predict.PredictRequestOrBuilder
    • getInputs

      @Deprecated public Map<String,TensorProto> getInputs()
      Deprecated.
      Use getInputsMap() instead.
      Specified by:
      getInputs in interface Predict.PredictRequestOrBuilder
    • getInputsMap

      public Map<String,TensorProto> getInputsMap()
       Input tensors.
       Names of input tensor are alias names. The mapping from aliases to real
       input tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'inputs' field.
       
      map<string, .tensorflow.TensorProto> inputs = 2;
      Specified by:
      getInputsMap in interface Predict.PredictRequestOrBuilder
    • getInputsOrDefault

      public TensorProto getInputsOrDefault(String key, TensorProto defaultValue)
       Input tensors.
       Names of input tensor are alias names. The mapping from aliases to real
       input tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'inputs' field.
       
      map<string, .tensorflow.TensorProto> inputs = 2;
      Specified by:
      getInputsOrDefault in interface Predict.PredictRequestOrBuilder
    • getInputsOrThrow

      public TensorProto getInputsOrThrow(String key)
       Input tensors.
       Names of input tensor are alias names. The mapping from aliases to real
       input tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'inputs' field.
       
      map<string, .tensorflow.TensorProto> inputs = 2;
      Specified by:
      getInputsOrThrow in interface Predict.PredictRequestOrBuilder
    • clearInputs

      public Predict.PredictRequest.Builder clearInputs()
    • removeInputs

      public Predict.PredictRequest.Builder removeInputs(String key)
       Input tensors.
       Names of input tensor are alias names. The mapping from aliases to real
       input tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'inputs' field.
       
      map<string, .tensorflow.TensorProto> inputs = 2;
    • getMutableInputs

      @Deprecated public Map<String,TensorProto> getMutableInputs()
      Deprecated.
      Use alternate mutation accessors instead.
    • putInputs

      public Predict.PredictRequest.Builder putInputs(String key, TensorProto value)
       Input tensors.
       Names of input tensor are alias names. The mapping from aliases to real
       input tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'inputs' field.
       
      map<string, .tensorflow.TensorProto> inputs = 2;
    • putAllInputs

      public Predict.PredictRequest.Builder putAllInputs(Map<String,TensorProto> values)
       Input tensors.
       Names of input tensor are alias names. The mapping from aliases to real
       input tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'inputs' field.
       
      map<string, .tensorflow.TensorProto> inputs = 2;
    • putInputsBuilderIfAbsent

      public TensorProto.Builder putInputsBuilderIfAbsent(String key)
       Input tensors.
       Names of input tensor are alias names. The mapping from aliases to real
       input tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'inputs' field.
       
      map<string, .tensorflow.TensorProto> inputs = 2;
    • getOutputFilterList

      public com.google.protobuf.ProtocolStringList getOutputFilterList()
       Output filter.
       Names specified are alias names. The mapping from aliases to real output
       tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'outputs' field.
       Only tensors specified here will be run/fetched and returned, with the
       exception that when none is specified, all tensors specified in the
       named signature will be run/fetched and returned.
       
      repeated string output_filter = 3;
      Specified by:
      getOutputFilterList in interface Predict.PredictRequestOrBuilder
      Returns:
      A list containing the outputFilter.
    • getOutputFilterCount

      public int getOutputFilterCount()
       Output filter.
       Names specified are alias names. The mapping from aliases to real output
       tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'outputs' field.
       Only tensors specified here will be run/fetched and returned, with the
       exception that when none is specified, all tensors specified in the
       named signature will be run/fetched and returned.
       
      repeated string output_filter = 3;
      Specified by:
      getOutputFilterCount in interface Predict.PredictRequestOrBuilder
      Returns:
      The count of outputFilter.
    • getOutputFilter

      public String getOutputFilter(int index)
       Output filter.
       Names specified are alias names. The mapping from aliases to real output
       tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'outputs' field.
       Only tensors specified here will be run/fetched and returned, with the
       exception that when none is specified, all tensors specified in the
       named signature will be run/fetched and returned.
       
      repeated string output_filter = 3;
      Specified by:
      getOutputFilter in interface Predict.PredictRequestOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The outputFilter at the given index.
    • getOutputFilterBytes

      public com.google.protobuf.ByteString getOutputFilterBytes(int index)
       Output filter.
       Names specified are alias names. The mapping from aliases to real output
       tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'outputs' field.
       Only tensors specified here will be run/fetched and returned, with the
       exception that when none is specified, all tensors specified in the
       named signature will be run/fetched and returned.
       
      repeated string output_filter = 3;
      Specified by:
      getOutputFilterBytes in interface Predict.PredictRequestOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the outputFilter at the given index.
    • setOutputFilter

      public Predict.PredictRequest.Builder setOutputFilter(int index, String value)
       Output filter.
       Names specified are alias names. The mapping from aliases to real output
       tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'outputs' field.
       Only tensors specified here will be run/fetched and returned, with the
       exception that when none is specified, all tensors specified in the
       named signature will be run/fetched and returned.
       
      repeated string output_filter = 3;
      Parameters:
      index - The index to set the value at.
      value - The outputFilter to set.
      Returns:
      This builder for chaining.
    • addOutputFilter

      public Predict.PredictRequest.Builder addOutputFilter(String value)
       Output filter.
       Names specified are alias names. The mapping from aliases to real output
       tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'outputs' field.
       Only tensors specified here will be run/fetched and returned, with the
       exception that when none is specified, all tensors specified in the
       named signature will be run/fetched and returned.
       
      repeated string output_filter = 3;
      Parameters:
      value - The outputFilter to add.
      Returns:
      This builder for chaining.
    • addAllOutputFilter

      public Predict.PredictRequest.Builder addAllOutputFilter(Iterable<String> values)
       Output filter.
       Names specified are alias names. The mapping from aliases to real output
       tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'outputs' field.
       Only tensors specified here will be run/fetched and returned, with the
       exception that when none is specified, all tensors specified in the
       named signature will be run/fetched and returned.
       
      repeated string output_filter = 3;
      Parameters:
      values - The outputFilter to add.
      Returns:
      This builder for chaining.
    • clearOutputFilter

      public Predict.PredictRequest.Builder clearOutputFilter()
       Output filter.
       Names specified are alias names. The mapping from aliases to real output
       tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'outputs' field.
       Only tensors specified here will be run/fetched and returned, with the
       exception that when none is specified, all tensors specified in the
       named signature will be run/fetched and returned.
       
      repeated string output_filter = 3;
      Returns:
      This builder for chaining.
    • addOutputFilterBytes

      public Predict.PredictRequest.Builder addOutputFilterBytes(com.google.protobuf.ByteString value)
       Output filter.
       Names specified are alias names. The mapping from aliases to real output
       tensor names is stored in the SavedModel export as a prediction
       SignatureDef under the 'outputs' field.
       Only tensors specified here will be run/fetched and returned, with the
       exception that when none is specified, all tensors specified in the
       named signature will be run/fetched and returned.
       
      repeated string output_filter = 3;
      Parameters:
      value - The bytes of the outputFilter to add.
      Returns:
      This builder for chaining.
    • hasPredictStreamedOptions

      public boolean hasPredictStreamedOptions()
       Options for streaming requests to control how multiple requests/responses
       are handled within a single stream.
       
      .tensorflow.serving.PredictStreamedOptions predict_streamed_options = 5;
      Specified by:
      hasPredictStreamedOptions in interface Predict.PredictRequestOrBuilder
      Returns:
      Whether the predictStreamedOptions field is set.
    • getPredictStreamedOptions

      public Predict.PredictStreamedOptions getPredictStreamedOptions()
       Options for streaming requests to control how multiple requests/responses
       are handled within a single stream.
       
      .tensorflow.serving.PredictStreamedOptions predict_streamed_options = 5;
      Specified by:
      getPredictStreamedOptions in interface Predict.PredictRequestOrBuilder
      Returns:
      The predictStreamedOptions.
    • setPredictStreamedOptions

      public Predict.PredictRequest.Builder setPredictStreamedOptions(Predict.PredictStreamedOptions value)
       Options for streaming requests to control how multiple requests/responses
       are handled within a single stream.
       
      .tensorflow.serving.PredictStreamedOptions predict_streamed_options = 5;
    • setPredictStreamedOptions

      public Predict.PredictRequest.Builder setPredictStreamedOptions(Predict.PredictStreamedOptions.Builder builderForValue)
       Options for streaming requests to control how multiple requests/responses
       are handled within a single stream.
       
      .tensorflow.serving.PredictStreamedOptions predict_streamed_options = 5;
    • mergePredictStreamedOptions

      public Predict.PredictRequest.Builder mergePredictStreamedOptions(Predict.PredictStreamedOptions value)
       Options for streaming requests to control how multiple requests/responses
       are handled within a single stream.
       
      .tensorflow.serving.PredictStreamedOptions predict_streamed_options = 5;
    • clearPredictStreamedOptions

      public Predict.PredictRequest.Builder clearPredictStreamedOptions()
       Options for streaming requests to control how multiple requests/responses
       are handled within a single stream.
       
      .tensorflow.serving.PredictStreamedOptions predict_streamed_options = 5;
    • getPredictStreamedOptionsBuilder

      public Predict.PredictStreamedOptions.Builder getPredictStreamedOptionsBuilder()
       Options for streaming requests to control how multiple requests/responses
       are handled within a single stream.
       
      .tensorflow.serving.PredictStreamedOptions predict_streamed_options = 5;
    • getPredictStreamedOptionsOrBuilder

      public Predict.PredictStreamedOptionsOrBuilder getPredictStreamedOptionsOrBuilder()
       Options for streaming requests to control how multiple requests/responses
       are handled within a single stream.
       
      .tensorflow.serving.PredictStreamedOptions predict_streamed_options = 5;
      Specified by:
      getPredictStreamedOptionsOrBuilder in interface Predict.PredictRequestOrBuilder
    • hasClientId

      public boolean hasClientId()
       Client identifier to group requests belonging to a specific entity.
       Example entities can be product ids, service names, user ids etc.
       Servers can use this to optimize placement, caching and colocation.
       TODO(b/329897437): Migrate to client_id in RequestOptions.
       
      optional bytes client_id = 6;
      Specified by:
      hasClientId in interface Predict.PredictRequestOrBuilder
      Returns:
      Whether the clientId field is set.
    • getClientId

      public com.google.protobuf.ByteString getClientId()
       Client identifier to group requests belonging to a specific entity.
       Example entities can be product ids, service names, user ids etc.
       Servers can use this to optimize placement, caching and colocation.
       TODO(b/329897437): Migrate to client_id in RequestOptions.
       
      optional bytes client_id = 6;
      Specified by:
      getClientId in interface Predict.PredictRequestOrBuilder
      Returns:
      The clientId.
    • setClientId

      public Predict.PredictRequest.Builder setClientId(com.google.protobuf.ByteString value)
       Client identifier to group requests belonging to a specific entity.
       Example entities can be product ids, service names, user ids etc.
       Servers can use this to optimize placement, caching and colocation.
       TODO(b/329897437): Migrate to client_id in RequestOptions.
       
      optional bytes client_id = 6;
      Parameters:
      value - The clientId to set.
      Returns:
      This builder for chaining.
    • clearClientId

      public Predict.PredictRequest.Builder clearClientId()
       Client identifier to group requests belonging to a specific entity.
       Example entities can be product ids, service names, user ids etc.
       Servers can use this to optimize placement, caching and colocation.
       TODO(b/329897437): Migrate to client_id in RequestOptions.
       
      optional bytes client_id = 6;
      Returns:
      This builder for chaining.
    • hasRequestOptions

      public boolean hasRequestOptions()
      optional .tensorflow.serving.PredictRequest.RequestOptions request_options = 7;
      Specified by:
      hasRequestOptions in interface Predict.PredictRequestOrBuilder
      Returns:
      Whether the requestOptions field is set.
    • getRequestOptions

      public Predict.PredictRequest.RequestOptions getRequestOptions()
      optional .tensorflow.serving.PredictRequest.RequestOptions request_options = 7;
      Specified by:
      getRequestOptions in interface Predict.PredictRequestOrBuilder
      Returns:
      The requestOptions.
    • setRequestOptions

      optional .tensorflow.serving.PredictRequest.RequestOptions request_options = 7;
    • setRequestOptions

      optional .tensorflow.serving.PredictRequest.RequestOptions request_options = 7;
    • mergeRequestOptions

      optional .tensorflow.serving.PredictRequest.RequestOptions request_options = 7;
    • clearRequestOptions

      public Predict.PredictRequest.Builder clearRequestOptions()
      optional .tensorflow.serving.PredictRequest.RequestOptions request_options = 7;
    • getRequestOptionsBuilder

      public Predict.PredictRequest.RequestOptions.Builder getRequestOptionsBuilder()
      optional .tensorflow.serving.PredictRequest.RequestOptions request_options = 7;
    • getRequestOptionsOrBuilder

      public Predict.PredictRequest.RequestOptionsOrBuilder getRequestOptionsOrBuilder()
      optional .tensorflow.serving.PredictRequest.RequestOptions request_options = 7;
      Specified by:
      getRequestOptionsOrBuilder in interface Predict.PredictRequestOrBuilder
    • setUnknownFields

      public final Predict.PredictRequest.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>
    • mergeUnknownFields

      public final Predict.PredictRequest.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Predict.PredictRequest.Builder>