Class PartitionAssignment.Builder (1.16.5)

public static final class PartitionAssignment.Builder extends GeneratedMessage.Builder<PartitionAssignment.Builder> implements PartitionAssignmentOrBuilder

PartitionAssignments should not race with acknowledgements. There should be exactly one unacknowledged PartitionAssignment at a time. If not, the client must break the stream.

Protobuf type google.cloud.pubsublite.v1.PartitionAssignment

Static Methods

getDescriptor()

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

Methods

addAllPartitions(Iterable<? extends Long> values)

public PartitionAssignment.Builder addAllPartitions(Iterable<? extends Long> values)

The list of partition numbers this subscriber is assigned to.

repeated int64 partitions = 1;

Parameter
Name Description
values Iterable<? extends java.lang.Long>

The partitions to add.

Returns
Type Description
PartitionAssignment.Builder

This builder for chaining.

addPartitions(long value)

public PartitionAssignment.Builder addPartitions(long value)

The list of partition numbers this subscriber is assigned to.

repeated int64 partitions = 1;

Parameter
Name Description
value long

The partitions to add.

Returns
Type Description
PartitionAssignment.Builder

This builder for chaining.

build()

public PartitionAssignment build()
Returns
Type Description
PartitionAssignment

buildPartial()

public PartitionAssignment buildPartial()
Returns
Type Description
PartitionAssignment

clear()

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

clearPartitions()

public PartitionAssignment.Builder clearPartitions()

The list of partition numbers this subscriber is assigned to.

repeated int64 partitions = 1;

Returns
Type Description
PartitionAssignment.Builder

This builder for chaining.

getDefaultInstanceForType()

public PartitionAssignment getDefaultInstanceForType()
Returns
Type Description
PartitionAssignment

getDescriptorForType()

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

getPartitions(int index)

public long getPartitions(int index)

The list of partition numbers this subscriber is assigned to.

repeated int64 partitions = 1;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
long

The partitions at the given index.

getPartitionsCount()

public int getPartitionsCount()

The list of partition numbers this subscriber is assigned to.

repeated int64 partitions = 1;

Returns
Type Description
int

The count of partitions.

getPartitionsList()

public List<Long> getPartitionsList()

The list of partition numbers this subscriber is assigned to.

repeated int64 partitions = 1;

Returns
Type Description
List<Long>

A list containing the partitions.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(PartitionAssignment other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

setPartitions(int index, long value)

public PartitionAssignment.Builder setPartitions(int index, long value)

The list of partition numbers this subscriber is assigned to.

repeated int64 partitions = 1;

Parameters
Name Description
index int

The index to set the value at.

value long

The partitions to set.

Returns
Type Description
PartitionAssignment.Builder

This builder for chaining.