Class TrafficPortSelector.Builder (0.3.0)

public static final class TrafficPortSelector.Builder extends GeneratedMessageV3.Builder<TrafficPortSelector.Builder> implements TrafficPortSelectorOrBuilder

Specification of a port-based selector.

Protobuf type google.cloud.networkservices.v1.TrafficPortSelector

Static Methods

getDescriptor()

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

Methods

addAllPorts(Iterable<String> values)

public TrafficPortSelector.Builder addAllPorts(Iterable<String> values)

Optional. A list of ports. Can be port numbers or port range (example, [80-90] specifies all ports from 80 to 90, including 80 and 90) or named ports or * to specify all ports. If the list is empty, all ports are selected.

repeated string ports = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Iterable<String>

The ports to add.

Returns
Type Description
TrafficPortSelector.Builder

This builder for chaining.

addPorts(String value)

public TrafficPortSelector.Builder addPorts(String value)

Optional. A list of ports. Can be port numbers or port range (example, [80-90] specifies all ports from 80 to 90, including 80 and 90) or named ports or * to specify all ports. If the list is empty, all ports are selected.

repeated string ports = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The ports to add.

Returns
Type Description
TrafficPortSelector.Builder

This builder for chaining.

addPortsBytes(ByteString value)

public TrafficPortSelector.Builder addPortsBytes(ByteString value)

Optional. A list of ports. Can be port numbers or port range (example, [80-90] specifies all ports from 80 to 90, including 80 and 90) or named ports or * to specify all ports. If the list is empty, all ports are selected.

repeated string ports = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes of the ports to add.

Returns
Type Description
TrafficPortSelector.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public TrafficPortSelector build()
Returns
Type Description
TrafficPortSelector

buildPartial()

public TrafficPortSelector buildPartial()
Returns
Type Description
TrafficPortSelector

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearPorts()

public TrafficPortSelector.Builder clearPorts()

Optional. A list of ports. Can be port numbers or port range (example, [80-90] specifies all ports from 80 to 90, including 80 and 90) or named ports or * to specify all ports. If the list is empty, all ports are selected.

repeated string ports = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
TrafficPortSelector.Builder

This builder for chaining.

clone()

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

getDefaultInstanceForType()

public TrafficPortSelector getDefaultInstanceForType()
Returns
Type Description
TrafficPortSelector

getDescriptorForType()

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

getPorts(int index)

public String getPorts(int index)

Optional. A list of ports. Can be port numbers or port range (example, [80-90] specifies all ports from 80 to 90, including 80 and 90) or named ports or * to specify all ports. If the list is empty, all ports are selected.

repeated string ports = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The ports at the given index.

getPortsBytes(int index)

public ByteString getPortsBytes(int index)

Optional. A list of ports. Can be port numbers or port range (example, [80-90] specifies all ports from 80 to 90, including 80 and 90) or named ports or * to specify all ports. If the list is empty, all ports are selected.

repeated string ports = 1 [(.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 ports at the given index.

getPortsCount()

public int getPortsCount()

Optional. A list of ports. Can be port numbers or port range (example, [80-90] specifies all ports from 80 to 90, including 80 and 90) or named ports or * to specify all ports. If the list is empty, all ports are selected.

repeated string ports = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The count of ports.

getPortsList()

public ProtocolStringList getPortsList()

Optional. A list of ports. Can be port numbers or port range (example, [80-90] specifies all ports from 80 to 90, including 80 and 90) or named ports or * to specify all ports. If the list is empty, all ports are selected.

repeated string ports = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProtocolStringList

A list containing the ports.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(TrafficPortSelector other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setField(Descriptors.FieldDescriptor field, Object value)

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

setPorts(int index, String value)

public TrafficPortSelector.Builder setPorts(int index, String value)

Optional. A list of ports. Can be port numbers or port range (example, [80-90] specifies all ports from 80 to 90, including 80 and 90) or named ports or * to specify all ports. If the list is empty, all ports are selected.

repeated string ports = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int

The index to set the value at.

value String

The ports to set.

Returns
Type Description
TrafficPortSelector.Builder

This builder for chaining.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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