Class PredictResponse.Builder (0.40.0)

public static final class PredictResponse.Builder extends GeneratedMessageV3.Builder<PredictResponse.Builder> implements PredictResponseOrBuilder

Response message for predict method.

Protobuf type google.cloud.recommendationengine.v1beta1.PredictResponse

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllItemsMissingInCatalog(Iterable<String> values)

public PredictResponse.Builder addAllItemsMissingInCatalog(Iterable<String> values)

IDs of items in the request that were missing from the catalog.

repeated string items_missing_in_catalog = 3;

Parameter
NameDescription
valuesIterable<String>

The itemsMissingInCatalog to add.

Returns
TypeDescription
PredictResponse.Builder

This builder for chaining.

addAllResults(Iterable<? extends PredictResponse.PredictionResult> values)

public PredictResponse.Builder addAllResults(Iterable<? extends PredictResponse.PredictionResult> values)

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult>
Returns
TypeDescription
PredictResponse.Builder

addItemsMissingInCatalog(String value)

public PredictResponse.Builder addItemsMissingInCatalog(String value)

IDs of items in the request that were missing from the catalog.

repeated string items_missing_in_catalog = 3;

Parameter
NameDescription
valueString

The itemsMissingInCatalog to add.

Returns
TypeDescription
PredictResponse.Builder

This builder for chaining.

addItemsMissingInCatalogBytes(ByteString value)

public PredictResponse.Builder addItemsMissingInCatalogBytes(ByteString value)

IDs of items in the request that were missing from the catalog.

repeated string items_missing_in_catalog = 3;

Parameter
NameDescription
valueByteString

The bytes of the itemsMissingInCatalog to add.

Returns
TypeDescription
PredictResponse.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public PredictResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
PredictResponse.Builder
Overrides

addResults(PredictResponse.PredictionResult value)

public PredictResponse.Builder addResults(PredictResponse.PredictionResult value)

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Parameter
NameDescription
valuePredictResponse.PredictionResult
Returns
TypeDescription
PredictResponse.Builder

addResults(PredictResponse.PredictionResult.Builder builderForValue)

public PredictResponse.Builder addResults(PredictResponse.PredictionResult.Builder builderForValue)

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Parameter
NameDescription
builderForValuePredictResponse.PredictionResult.Builder
Returns
TypeDescription
PredictResponse.Builder

addResults(int index, PredictResponse.PredictionResult value)

public PredictResponse.Builder addResults(int index, PredictResponse.PredictionResult value)

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Parameters
NameDescription
indexint
valuePredictResponse.PredictionResult
Returns
TypeDescription
PredictResponse.Builder

addResults(int index, PredictResponse.PredictionResult.Builder builderForValue)

public PredictResponse.Builder addResults(int index, PredictResponse.PredictionResult.Builder builderForValue)

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Parameters
NameDescription
indexint
builderForValuePredictResponse.PredictionResult.Builder
Returns
TypeDescription
PredictResponse.Builder

addResultsBuilder()

public PredictResponse.PredictionResult.Builder addResultsBuilder()

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Returns
TypeDescription
PredictResponse.PredictionResult.Builder

addResultsBuilder(int index)

public PredictResponse.PredictionResult.Builder addResultsBuilder(int index)

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
PredictResponse.PredictionResult.Builder

build()

public PredictResponse build()
Returns
TypeDescription
PredictResponse

buildPartial()

public PredictResponse buildPartial()
Returns
TypeDescription
PredictResponse

clear()

public PredictResponse.Builder clear()
Returns
TypeDescription
PredictResponse.Builder
Overrides

clearDryRun()

public PredictResponse.Builder clearDryRun()

True if the dryRun property was set in the request.

bool dry_run = 4;

Returns
TypeDescription
PredictResponse.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public PredictResponse.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
PredictResponse.Builder
Overrides

clearItemsMissingInCatalog()

public PredictResponse.Builder clearItemsMissingInCatalog()

IDs of items in the request that were missing from the catalog.

repeated string items_missing_in_catalog = 3;

Returns
TypeDescription
PredictResponse.Builder

This builder for chaining.

clearMetadata()

public PredictResponse.Builder clearMetadata()
Returns
TypeDescription
PredictResponse.Builder

clearNextPageToken()

public PredictResponse.Builder clearNextPageToken()

If empty, the list is complete. If nonempty, the token to pass to the next request's PredictRequest.page_token.

string next_page_token = 6;

Returns
TypeDescription
PredictResponse.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public PredictResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
PredictResponse.Builder
Overrides

clearRecommendationToken()

public PredictResponse.Builder clearRecommendationToken()

A unique recommendation token. This should be included in the user event logs resulting from this recommendation, which enables accurate attribution of recommendation model performance.

string recommendation_token = 2;

Returns
TypeDescription
PredictResponse.Builder

This builder for chaining.

clearResults()

public PredictResponse.Builder clearResults()

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Returns
TypeDescription
PredictResponse.Builder

clone()

public PredictResponse.Builder clone()
Returns
TypeDescription
PredictResponse.Builder
Overrides

containsMetadata(String key)

public boolean containsMetadata(String key)

Additional domain specific prediction response metadata.

map<string, .google.protobuf.Value> metadata = 5;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getDefaultInstanceForType()

public PredictResponse getDefaultInstanceForType()
Returns
TypeDescription
PredictResponse

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDryRun()

public boolean getDryRun()

True if the dryRun property was set in the request.

bool dry_run = 4;

Returns
TypeDescription
boolean

The dryRun.

getItemsMissingInCatalog(int index)

public String getItemsMissingInCatalog(int index)

IDs of items in the request that were missing from the catalog.

repeated string items_missing_in_catalog = 3;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The itemsMissingInCatalog at the given index.

getItemsMissingInCatalogBytes(int index)

public ByteString getItemsMissingInCatalogBytes(int index)

IDs of items in the request that were missing from the catalog.

repeated string items_missing_in_catalog = 3;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the itemsMissingInCatalog at the given index.

getItemsMissingInCatalogCount()

public int getItemsMissingInCatalogCount()

IDs of items in the request that were missing from the catalog.

repeated string items_missing_in_catalog = 3;

Returns
TypeDescription
int

The count of itemsMissingInCatalog.

getItemsMissingInCatalogList()

public ProtocolStringList getItemsMissingInCatalogList()

IDs of items in the request that were missing from the catalog.

repeated string items_missing_in_catalog = 3;

Returns
TypeDescription
ProtocolStringList

A list containing the itemsMissingInCatalog.

getMetadata() (deprecated)

public Map<String,Value> getMetadata()

Use #getMetadataMap() instead.

Returns
TypeDescription
Map<String,Value>

getMetadataCount()

public int getMetadataCount()

Additional domain specific prediction response metadata.

map<string, .google.protobuf.Value> metadata = 5;

Returns
TypeDescription
int

getMetadataMap()

public Map<String,Value> getMetadataMap()

Additional domain specific prediction response metadata.

map<string, .google.protobuf.Value> metadata = 5;

Returns
TypeDescription
Map<String,Value>

getMetadataOrDefault(String key, Value defaultValue)

public Value getMetadataOrDefault(String key, Value defaultValue)

Additional domain specific prediction response metadata.

map<string, .google.protobuf.Value> metadata = 5;

Parameters
NameDescription
keyString
defaultValueValue
Returns
TypeDescription
Value

getMetadataOrThrow(String key)

public Value getMetadataOrThrow(String key)

Additional domain specific prediction response metadata.

map<string, .google.protobuf.Value> metadata = 5;

Parameter
NameDescription
keyString
Returns
TypeDescription
Value

getMutableMetadata() (deprecated)

public Map<String,Value> getMutableMetadata()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,Value>

getNextPageToken()

public String getNextPageToken()

If empty, the list is complete. If nonempty, the token to pass to the next request's PredictRequest.page_token.

string next_page_token = 6;

Returns
TypeDescription
String

The nextPageToken.

getNextPageTokenBytes()

public ByteString getNextPageTokenBytes()

If empty, the list is complete. If nonempty, the token to pass to the next request's PredictRequest.page_token.

string next_page_token = 6;

Returns
TypeDescription
ByteString

The bytes for nextPageToken.

getRecommendationToken()

public String getRecommendationToken()

A unique recommendation token. This should be included in the user event logs resulting from this recommendation, which enables accurate attribution of recommendation model performance.

string recommendation_token = 2;

Returns
TypeDescription
String

The recommendationToken.

getRecommendationTokenBytes()

public ByteString getRecommendationTokenBytes()

A unique recommendation token. This should be included in the user event logs resulting from this recommendation, which enables accurate attribution of recommendation model performance.

string recommendation_token = 2;

Returns
TypeDescription
ByteString

The bytes for recommendationToken.

getResults(int index)

public PredictResponse.PredictionResult getResults(int index)

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
PredictResponse.PredictionResult

getResultsBuilder(int index)

public PredictResponse.PredictionResult.Builder getResultsBuilder(int index)

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
PredictResponse.PredictionResult.Builder

getResultsBuilderList()

public List<PredictResponse.PredictionResult.Builder> getResultsBuilderList()

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Returns
TypeDescription
List<Builder>

getResultsCount()

public int getResultsCount()

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Returns
TypeDescription
int

getResultsList()

public List<PredictResponse.PredictionResult> getResultsList()

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Returns
TypeDescription
List<PredictionResult>

getResultsOrBuilder(int index)

public PredictResponse.PredictionResultOrBuilder getResultsOrBuilder(int index)

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
PredictResponse.PredictionResultOrBuilder

getResultsOrBuilderList()

public List<? extends PredictResponse.PredictionResultOrBuilder> getResultsOrBuilderList()

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Returns
TypeDescription
List<? extends com.google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResultOrBuilder>

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(PredictResponse other)

public PredictResponse.Builder mergeFrom(PredictResponse other)
Parameter
NameDescription
otherPredictResponse
Returns
TypeDescription
PredictResponse.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public PredictResponse.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PredictResponse.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public PredictResponse.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
PredictResponse.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final PredictResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PredictResponse.Builder
Overrides

putAllMetadata(Map<String,Value> values)

public PredictResponse.Builder putAllMetadata(Map<String,Value> values)

Additional domain specific prediction response metadata.

map<string, .google.protobuf.Value> metadata = 5;

Parameter
NameDescription
valuesMap<String,Value>
Returns
TypeDescription
PredictResponse.Builder

putMetadata(String key, Value value)

public PredictResponse.Builder putMetadata(String key, Value value)

Additional domain specific prediction response metadata.

map<string, .google.protobuf.Value> metadata = 5;

Parameters
NameDescription
keyString
valueValue
Returns
TypeDescription
PredictResponse.Builder

removeMetadata(String key)

public PredictResponse.Builder removeMetadata(String key)

Additional domain specific prediction response metadata.

map<string, .google.protobuf.Value> metadata = 5;

Parameter
NameDescription
keyString
Returns
TypeDescription
PredictResponse.Builder

removeResults(int index)

public PredictResponse.Builder removeResults(int index)

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
PredictResponse.Builder

setDryRun(boolean value)

public PredictResponse.Builder setDryRun(boolean value)

True if the dryRun property was set in the request.

bool dry_run = 4;

Parameter
NameDescription
valueboolean

The dryRun to set.

Returns
TypeDescription
PredictResponse.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public PredictResponse.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
PredictResponse.Builder
Overrides

setItemsMissingInCatalog(int index, String value)

public PredictResponse.Builder setItemsMissingInCatalog(int index, String value)

IDs of items in the request that were missing from the catalog.

repeated string items_missing_in_catalog = 3;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The itemsMissingInCatalog to set.

Returns
TypeDescription
PredictResponse.Builder

This builder for chaining.

setNextPageToken(String value)

public PredictResponse.Builder setNextPageToken(String value)

If empty, the list is complete. If nonempty, the token to pass to the next request's PredictRequest.page_token.

string next_page_token = 6;

Parameter
NameDescription
valueString

The nextPageToken to set.

Returns
TypeDescription
PredictResponse.Builder

This builder for chaining.

setNextPageTokenBytes(ByteString value)

public PredictResponse.Builder setNextPageTokenBytes(ByteString value)

If empty, the list is complete. If nonempty, the token to pass to the next request's PredictRequest.page_token.

string next_page_token = 6;

Parameter
NameDescription
valueByteString

The bytes for nextPageToken to set.

Returns
TypeDescription
PredictResponse.Builder

This builder for chaining.

setRecommendationToken(String value)

public PredictResponse.Builder setRecommendationToken(String value)

A unique recommendation token. This should be included in the user event logs resulting from this recommendation, which enables accurate attribution of recommendation model performance.

string recommendation_token = 2;

Parameter
NameDescription
valueString

The recommendationToken to set.

Returns
TypeDescription
PredictResponse.Builder

This builder for chaining.

setRecommendationTokenBytes(ByteString value)

public PredictResponse.Builder setRecommendationTokenBytes(ByteString value)

A unique recommendation token. This should be included in the user event logs resulting from this recommendation, which enables accurate attribution of recommendation model performance.

string recommendation_token = 2;

Parameter
NameDescription
valueByteString

The bytes for recommendationToken to set.

Returns
TypeDescription
PredictResponse.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public PredictResponse.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
PredictResponse.Builder
Overrides

setResults(int index, PredictResponse.PredictionResult value)

public PredictResponse.Builder setResults(int index, PredictResponse.PredictionResult value)

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Parameters
NameDescription
indexint
valuePredictResponse.PredictionResult
Returns
TypeDescription
PredictResponse.Builder

setResults(int index, PredictResponse.PredictionResult.Builder builderForValue)

public PredictResponse.Builder setResults(int index, PredictResponse.PredictionResult.Builder builderForValue)

A list of recommended items. The order represents the ranking (from the most relevant item to the least).

repeated .google.cloud.recommendationengine.v1beta1.PredictResponse.PredictionResult results = 1;

Parameters
NameDescription
indexint
builderForValuePredictResponse.PredictionResult.Builder
Returns
TypeDescription
PredictResponse.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final PredictResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PredictResponse.Builder
Overrides