Class SearchHypernym.Builder (0.6.0)

public static final class SearchHypernym.Builder extends GeneratedMessageV3.Builder<SearchHypernym.Builder> implements SearchHypernymOrBuilder

Search resource: SearchHypernym. For example, { hypernym: "vehicle" hyponyms: ["sedan", "truck"] } This means in SMART_SEARCH mode, searching for "vehicle" will also return results with "sedan" or "truck" as annotations.

Protobuf type google.cloud.visionai.v1.SearchHypernym

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllHyponyms(Iterable<String> values)

public SearchHypernym.Builder addAllHyponyms(Iterable<String> values)

Optional. Hyponyms that the hypernym is mapped to.

repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Iterable<String>

The hyponyms to add.

Returns
Type Description
SearchHypernym.Builder

This builder for chaining.

addHyponyms(String value)

public SearchHypernym.Builder addHyponyms(String value)

Optional. Hyponyms that the hypernym is mapped to.

repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The hyponyms to add.

Returns
Type Description
SearchHypernym.Builder

This builder for chaining.

addHyponymsBytes(ByteString value)

public SearchHypernym.Builder addHyponymsBytes(ByteString value)

Optional. Hyponyms that the hypernym is mapped to.

repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes of the hyponyms to add.

Returns
Type Description
SearchHypernym.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public SearchHypernym.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SearchHypernym.Builder
Overrides

build()

public SearchHypernym build()
Returns
Type Description
SearchHypernym

buildPartial()

public SearchHypernym buildPartial()
Returns
Type Description
SearchHypernym

clear()

public SearchHypernym.Builder clear()
Returns
Type Description
SearchHypernym.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public SearchHypernym.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
SearchHypernym.Builder
Overrides

clearHypernym()

public SearchHypernym.Builder clearHypernym()

Optional. The hypernym.

string hypernym = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
SearchHypernym.Builder

This builder for chaining.

clearHyponyms()

public SearchHypernym.Builder clearHyponyms()

Optional. Hyponyms that the hypernym is mapped to.

repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
SearchHypernym.Builder

This builder for chaining.

clearName()

public SearchHypernym.Builder clearName()

Resource name of the SearchHypernym. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}

string name = 1;

Returns
Type Description
SearchHypernym.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public SearchHypernym.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
SearchHypernym.Builder
Overrides

clone()

public SearchHypernym.Builder clone()
Returns
Type Description
SearchHypernym.Builder
Overrides

getDefaultInstanceForType()

public SearchHypernym getDefaultInstanceForType()
Returns
Type Description
SearchHypernym

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getHypernym()

public String getHypernym()

Optional. The hypernym.

string hypernym = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The hypernym.

getHypernymBytes()

public ByteString getHypernymBytes()

Optional. The hypernym.

string hypernym = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for hypernym.

getHyponyms(int index)

public String getHyponyms(int index)

Optional. Hyponyms that the hypernym is mapped to.

repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The hyponyms at the given index.

getHyponymsBytes(int index)

public ByteString getHyponymsBytes(int index)

Optional. Hyponyms that the hypernym is mapped to.

repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the hyponyms at the given index.

getHyponymsCount()

public int getHyponymsCount()

Optional. Hyponyms that the hypernym is mapped to.

repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The count of hyponyms.

getHyponymsList()

public ProtocolStringList getHyponymsList()

Optional. Hyponyms that the hypernym is mapped to.

repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProtocolStringList

A list containing the hyponyms.

getName()

public String getName()

Resource name of the SearchHypernym. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Resource name of the SearchHypernym. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(SearchHypernym other)

public SearchHypernym.Builder mergeFrom(SearchHypernym other)
Parameter
Name Description
other SearchHypernym
Returns
Type Description
SearchHypernym.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public SearchHypernym.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SearchHypernym.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public SearchHypernym.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
SearchHypernym.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SearchHypernym.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SearchHypernym.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public SearchHypernym.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
SearchHypernym.Builder
Overrides

setHypernym(String value)

public SearchHypernym.Builder setHypernym(String value)

Optional. The hypernym.

string hypernym = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The hypernym to set.

Returns
Type Description
SearchHypernym.Builder

This builder for chaining.

setHypernymBytes(ByteString value)

public SearchHypernym.Builder setHypernymBytes(ByteString value)

Optional. The hypernym.

string hypernym = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for hypernym to set.

Returns
Type Description
SearchHypernym.Builder

This builder for chaining.

setHyponyms(int index, String value)

public SearchHypernym.Builder setHyponyms(int index, String value)

Optional. Hyponyms that the hypernym is mapped to.

repeated string hyponyms = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int

The index to set the value at.

value String

The hyponyms to set.

Returns
Type Description
SearchHypernym.Builder

This builder for chaining.

setName(String value)

public SearchHypernym.Builder setName(String value)

Resource name of the SearchHypernym. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
SearchHypernym.Builder

This builder for chaining.

setNameBytes(ByteString value)

public SearchHypernym.Builder setNameBytes(ByteString value)

Resource name of the SearchHypernym. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
SearchHypernym.Builder

This builder for chaining.

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

public SearchHypernym.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
SearchHypernym.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final SearchHypernym.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
SearchHypernym.Builder
Overrides