Class LocationPolicy.Builder (1.45.0)

public static final class LocationPolicy.Builder extends GeneratedMessageV3.Builder<LocationPolicy.Builder> implements LocationPolicyOrBuilder

Configuration for location policy among multiple possible locations (e.g. preferences for zone selection among zones in a single region).

Protobuf type google.cloud.compute.v1.LocationPolicy

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public LocationPolicy build()
Returns
TypeDescription
LocationPolicy

buildPartial()

public LocationPolicy buildPartial()
Returns
TypeDescription
LocationPolicy

clear()

public LocationPolicy.Builder clear()
Returns
TypeDescription
LocationPolicy.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public LocationPolicy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
LocationPolicy.Builder
Overrides

clearLocations()

public LocationPolicy.Builder clearLocations()
Returns
TypeDescription
LocationPolicy.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public LocationPolicy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
LocationPolicy.Builder
Overrides

clearTargetShape()

public LocationPolicy.Builder clearTargetShape()

Strategy for distributing VMs across zones in a region. Check the TargetShape enum for the list of possible values.

optional string target_shape = 338621299;

Returns
TypeDescription
LocationPolicy.Builder

This builder for chaining.

clone()

public LocationPolicy.Builder clone()
Returns
TypeDescription
LocationPolicy.Builder
Overrides

containsLocations(String key)

public boolean containsLocations(String key)

Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a.

map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getDefaultInstanceForType()

public LocationPolicy getDefaultInstanceForType()
Returns
TypeDescription
LocationPolicy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getLocations() (deprecated)

public Map<String,LocationPolicyLocation> getLocations()

Use #getLocationsMap() instead.

Returns
TypeDescription
Map<String,LocationPolicyLocation>

getLocationsCount()

public int getLocationsCount()

Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a.

map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;

Returns
TypeDescription
int

getLocationsMap()

public Map<String,LocationPolicyLocation> getLocationsMap()

Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a.

map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;

Returns
TypeDescription
Map<String,LocationPolicyLocation>

getLocationsOrDefault(String key, LocationPolicyLocation defaultValue)

public LocationPolicyLocation getLocationsOrDefault(String key, LocationPolicyLocation defaultValue)

Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a.

map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;

Parameters
NameDescription
keyString
defaultValueLocationPolicyLocation
Returns
TypeDescription
LocationPolicyLocation

getLocationsOrThrow(String key)

public LocationPolicyLocation getLocationsOrThrow(String key)

Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a.

map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;

Parameter
NameDescription
keyString
Returns
TypeDescription
LocationPolicyLocation

getMutableLocations() (deprecated)

public Map<String,LocationPolicyLocation> getMutableLocations()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,LocationPolicyLocation>

getTargetShape()

public String getTargetShape()

Strategy for distributing VMs across zones in a region. Check the TargetShape enum for the list of possible values.

optional string target_shape = 338621299;

Returns
TypeDescription
String

The targetShape.

getTargetShapeBytes()

public ByteString getTargetShapeBytes()

Strategy for distributing VMs across zones in a region. Check the TargetShape enum for the list of possible values.

optional string target_shape = 338621299;

Returns
TypeDescription
ByteString

The bytes for targetShape.

hasTargetShape()

public boolean hasTargetShape()

Strategy for distributing VMs across zones in a region. Check the TargetShape enum for the list of possible values.

optional string target_shape = 338621299;

Returns
TypeDescription
boolean

Whether the targetShape field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(LocationPolicy other)

public LocationPolicy.Builder mergeFrom(LocationPolicy other)
Parameter
NameDescription
otherLocationPolicy
Returns
TypeDescription
LocationPolicy.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final LocationPolicy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
LocationPolicy.Builder
Overrides

putAllLocations(Map<String,LocationPolicyLocation> values)

public LocationPolicy.Builder putAllLocations(Map<String,LocationPolicyLocation> values)

Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a.

map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;

Parameter
NameDescription
valuesMap<String,LocationPolicyLocation>
Returns
TypeDescription
LocationPolicy.Builder

putLocations(String key, LocationPolicyLocation value)

public LocationPolicy.Builder putLocations(String key, LocationPolicyLocation value)

Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a.

map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;

Parameters
NameDescription
keyString
valueLocationPolicyLocation
Returns
TypeDescription
LocationPolicy.Builder

putLocationsBuilderIfAbsent(String key)

public LocationPolicyLocation.Builder putLocationsBuilderIfAbsent(String key)

Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a.

map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;

Parameter
NameDescription
keyString
Returns
TypeDescription
LocationPolicyLocation.Builder

removeLocations(String key)

public LocationPolicy.Builder removeLocations(String key)

Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a.

map<string, .google.cloud.compute.v1.LocationPolicyLocation> locations = 413423454;

Parameter
NameDescription
keyString
Returns
TypeDescription
LocationPolicy.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

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

public LocationPolicy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
LocationPolicy.Builder
Overrides

setTargetShape(String value)

public LocationPolicy.Builder setTargetShape(String value)

Strategy for distributing VMs across zones in a region. Check the TargetShape enum for the list of possible values.

optional string target_shape = 338621299;

Parameter
NameDescription
valueString

The targetShape to set.

Returns
TypeDescription
LocationPolicy.Builder

This builder for chaining.

setTargetShapeBytes(ByteString value)

public LocationPolicy.Builder setTargetShapeBytes(ByteString value)

Strategy for distributing VMs across zones in a region. Check the TargetShape enum for the list of possible values.

optional string target_shape = 338621299;

Parameter
NameDescription
valueByteString

The bytes for targetShape to set.

Returns
TypeDescription
LocationPolicy.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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