public static final class BitSequence.Builder extends GeneratedMessageV3.Builder<BitSequence.Builder> implements BitSequenceOrBuilder
A sequence of bits, encoded in a byte array.
Each byte in the bitmap
byte array stores 8 bits of the sequence. The only
exception is the last byte, which may store 8 or fewer bits. The padding
defines the number of bits of the last byte to be ignored as "padding". The
values of these "padding" bits are unspecified and must be ignored.
To retrieve the first bit, bit 0, calculate: (bitmap[0] & 0x01) != 0
.
To retrieve the second bit, bit 1, calculate: (bitmap[0] & 0x02) != 0
.
To retrieve the third bit, bit 2, calculate: (bitmap[0] & 0x04) != 0
.
To retrieve the fourth bit, bit 3, calculate: (bitmap[0] & 0x08) != 0
.
To retrieve bit n, calculate: (bitmap[n / 8] & (0x01 << (n % 8))) != 0
.
The "size" of a BitSequence
(the number of bits it contains) is calculated
by this formula: (bitmap.length * 8) - padding
.
Protobuf type google.firestore.v1.BitSequence
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public BitSequence.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
build()
public BitSequence build()
buildPartial()
public BitSequence buildPartial()
clear()
public BitSequence.Builder clear()
Overrides
clearBitmap()
public BitSequence.Builder clearBitmap()
The bytes that encode the bit sequence.
May have a length of zero.
bytes bitmap = 1;
clearField(Descriptors.FieldDescriptor field)
public BitSequence.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public BitSequence.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
clearPadding()
public BitSequence.Builder clearPadding()
The number of bits of the last byte in bitmap
to ignore as "padding".
If the length of bitmap
is zero, then this value must be 0
.
Otherwise, this value must be between 0 and 7, inclusive.
int32 padding = 2;
clone()
public BitSequence.Builder clone()
Overrides
getBitmap()
public ByteString getBitmap()
The bytes that encode the bit sequence.
May have a length of zero.
bytes bitmap = 1;
getDefaultInstanceForType()
public BitSequence getDefaultInstanceForType()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Overrides
getPadding()
The number of bits of the last byte in bitmap
to ignore as "padding".
If the length of bitmap
is zero, then this value must be 0
.
Otherwise, this value must be between 0 and 7, inclusive.
int32 padding = 2;
Returns |
---|
Type | Description |
int | The padding.
|
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
mergeFrom(BitSequence other)
public BitSequence.Builder mergeFrom(BitSequence other)
public BitSequence.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public BitSequence.Builder mergeFrom(Message other)
Parameter |
---|
Name | Description |
other | Message
|
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final BitSequence.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
setBitmap(ByteString value)
public BitSequence.Builder setBitmap(ByteString value)
The bytes that encode the bit sequence.
May have a length of zero.
bytes bitmap = 1;
Parameter |
---|
Name | Description |
value | ByteString
The bitmap to set.
|
setField(Descriptors.FieldDescriptor field, Object value)
public BitSequence.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
setPadding(int value)
public BitSequence.Builder setPadding(int value)
The number of bits of the last byte in bitmap
to ignore as "padding".
If the length of bitmap
is zero, then this value must be 0
.
Otherwise, this value must be between 0 and 7, inclusive.
int32 padding = 2;
Parameter |
---|
Name | Description |
value | int
The padding to set.
|
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public BitSequence.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final BitSequence.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides