Class FixedOrPercent.Builder (1.9.1)

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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public FixedOrPercent.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
FixedOrPercent.Builder
Overrides

build()

public FixedOrPercent build()
Returns
TypeDescription
FixedOrPercent

buildPartial()

public FixedOrPercent buildPartial()
Returns
TypeDescription
FixedOrPercent

clear()

public FixedOrPercent.Builder clear()
Returns
TypeDescription
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
TypeDescription
FixedOrPercent.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public FixedOrPercent.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
FixedOrPercent.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public FixedOrPercent.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
FixedOrPercent.Builder

This builder for chaining.

clone()

public FixedOrPercent.Builder clone()
Returns
TypeDescription
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
TypeDescription
int

The calculated.

getDefaultInstanceForType()

public FixedOrPercent getDefaultInstanceForType()
Returns
TypeDescription
FixedOrPercent

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getFixed()

public int getFixed()

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

optional int32 fixed = 97445748;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the percent field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(FixedOrPercent other)

public FixedOrPercent.Builder mergeFrom(FixedOrPercent other)
Parameter
NameDescription
otherFixedOrPercent
Returns
TypeDescription
FixedOrPercent.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public FixedOrPercent.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
FixedOrPercent.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public FixedOrPercent.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
FixedOrPercent.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final FixedOrPercent.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueint

The calculated to set.

Returns
TypeDescription
FixedOrPercent.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public FixedOrPercent.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueint

The fixed to set.

Returns
TypeDescription
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
NameDescription
valueint

The percent to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
FixedOrPercent.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final FixedOrPercent.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
FixedOrPercent.Builder
Overrides