Class FixedOrPercent.Builder (1.52.0)

public static final class FixedOrPercent.Builder extends GeneratedMessageV3.Builder<FixedOrPercent.Builder> implements FixedOrPercentOrBuilder

Encapsulates numeric value that can be either absolute or relative.

Protobuf type google.cloud.compute.v1.FixedOrPercent

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public FixedOrPercent build()
Returns
Type Description
FixedOrPercent

buildPartial()

public FixedOrPercent buildPartial()
Returns
Type Description
FixedOrPercent

clear()

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

clearCalculated()

public FixedOrPercent.Builder clearCalculated()

[Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded.

optional int32 calculated = 472082878;

Returns
Type Description
FixedOrPercent.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearFixed()

public FixedOrPercent.Builder clearFixed()

Specifies a fixed number of VM instances. This must be a positive integer.

optional int32 fixed = 97445748;

Returns
Type Description
FixedOrPercent.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearPercent()

public FixedOrPercent.Builder clearPercent()

Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.

optional int32 percent = 394814533;

Returns
Type Description
FixedOrPercent.Builder

This builder for chaining.

clone()

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

getCalculated()

public int getCalculated()

[Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded.

optional int32 calculated = 472082878;

Returns
Type Description
int

The calculated.

getDefaultInstanceForType()

public FixedOrPercent getDefaultInstanceForType()
Returns
Type Description
FixedOrPercent

getDescriptorForType()

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

getFixed()

public int getFixed()

Specifies a fixed number of VM instances. This must be a positive integer.

optional int32 fixed = 97445748;

Returns
Type Description
int

The fixed.

getPercent()

public int getPercent()

Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.

optional int32 percent = 394814533;

Returns
Type Description
int

The percent.

hasCalculated()

public boolean hasCalculated()

[Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded.

optional int32 calculated = 472082878;

Returns
Type Description
boolean

Whether the calculated field is set.

hasFixed()

public boolean hasFixed()

Specifies a fixed number of VM instances. This must be a positive integer.

optional int32 fixed = 97445748;

Returns
Type Description
boolean

Whether the fixed field is set.

hasPercent()

public boolean hasPercent()

Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.

optional int32 percent = 394814533;

Returns
Type Description
boolean

Whether the percent field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(FixedOrPercent other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setCalculated(int value)

public FixedOrPercent.Builder setCalculated(int value)

[Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded.

optional int32 calculated = 472082878;

Parameter
Name Description
value int

The calculated to set.

Returns
Type Description
FixedOrPercent.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setFixed(int value)

public FixedOrPercent.Builder setFixed(int value)

Specifies a fixed number of VM instances. This must be a positive integer.

optional int32 fixed = 97445748;

Parameter
Name Description
value int

The fixed to set.

Returns
Type Description
FixedOrPercent.Builder

This builder for chaining.

setPercent(int value)

public FixedOrPercent.Builder setPercent(int value)

Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.

optional int32 percent = 394814533;

Parameter
Name Description
value int

The percent to set.

Returns
Type Description
FixedOrPercent.Builder

This builder for chaining.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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