Class LocationPolicy.Builder (1.54.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
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public LocationPolicy build()
Returns
Type Description
LocationPolicy

buildPartial()

public LocationPolicy buildPartial()
Returns
Type Description
LocationPolicy

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearLocations()

public LocationPolicy.Builder clearLocations()
Returns
Type Description
LocationPolicy.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public LocationPolicy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
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
Type Description
LocationPolicy.Builder

This builder for chaining.

clone()

public LocationPolicy.Builder clone()
Returns
Type Description
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
Name Description
key String
Returns
Type Description
boolean

getDefaultInstanceForType()

public LocationPolicy getDefaultInstanceForType()
Returns
Type Description
LocationPolicy

getDescriptorForType()

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

getLocations() (deprecated)

public Map<String,LocationPolicyLocation> getLocations()

Use #getLocationsMap() instead.

Returns
Type Description
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
Type Description
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
Type Description
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
Name Description
key String
defaultValue LocationPolicyLocation
Returns
Type Description
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
Name Description
key String
Returns
Type Description
LocationPolicyLocation

getMutableLocations() (deprecated)

public Map<String,LocationPolicyLocation> getMutableLocations()

Use alternate mutation accessors instead.

Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
boolean

Whether the targetShape field is set.

internalGetFieldAccessorTable()

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

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(LocationPolicy other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final LocationPolicy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
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
Name Description
values Map<String,LocationPolicyLocation>
Returns
Type Description
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
Name Description
key String
value LocationPolicyLocation
Returns
Type Description
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
Name Description
key String
Returns
Type Description
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
Name Description
key String
Returns
Type Description
LocationPolicy.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

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

public LocationPolicy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
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
Name Description
value String

The targetShape to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for targetShape to set.

Returns
Type Description
LocationPolicy.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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