Class Viewport.Builder (2.44.0)

public static final class Viewport.Builder extends GeneratedMessageV3.Builder<Viewport.Builder> implements ViewportOrBuilder

A latitude-longitude viewport, represented as two diagonally opposite low and high points. A viewport is considered a closed region, i.e. it includes its boundary. The latitude bounds must range between -90 to 90 degrees inclusive, and the longitude bounds must range between -180 to 180 degrees inclusive. Various cases include:

  • If low = high, the viewport consists of that single point.

  • If low.longitude > high.longitude, the longitude range is inverted (the viewport crosses the 180 degree longitude line).

  • If low.longitude = -180 degrees and high.longitude = 180 degrees, the viewport includes all longitudes.

  • If low.longitude = 180 degrees and high.longitude = -180 degrees, the longitude range is empty.

  • If low.latitude > high.latitude, the latitude range is empty.

    Both low and high must be populated, and the represented box cannot be empty (as specified by the definitions above). An empty viewport will result in an error.

    For example, this viewport fully encloses New York City:

    { "low": { "latitude": 40.477398, "longitude": -74.259087 }, "high": { "latitude": 40.91618, "longitude": -73.70018 } }

Protobuf type google.geo.type.Viewport

Implements

ViewportOrBuilder

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Viewport build()
Returns
Type Description
Viewport

buildPartial()

public Viewport buildPartial()
Returns
Type Description
Viewport

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearHigh()

public Viewport.Builder clearHigh()

Required. The high point of the viewport.

.google.type.LatLng high = 2;

Returns
Type Description
Viewport.Builder

clearLow()

public Viewport.Builder clearLow()

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Returns
Type Description
Viewport.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

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

getDefaultInstanceForType()

public Viewport getDefaultInstanceForType()
Returns
Type Description
Viewport

getDescriptorForType()

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

getHigh()

public LatLng getHigh()

Required. The high point of the viewport.

.google.type.LatLng high = 2;

Returns
Type Description
LatLng

The high.

getHighBuilder()

public LatLng.Builder getHighBuilder()

Required. The high point of the viewport.

.google.type.LatLng high = 2;

Returns
Type Description
LatLng.Builder

getHighOrBuilder()

public LatLngOrBuilder getHighOrBuilder()

Required. The high point of the viewport.

.google.type.LatLng high = 2;

Returns
Type Description
LatLngOrBuilder

getLow()

public LatLng getLow()

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Returns
Type Description
LatLng

The low.

getLowBuilder()

public LatLng.Builder getLowBuilder()

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Returns
Type Description
LatLng.Builder

getLowOrBuilder()

public LatLngOrBuilder getLowOrBuilder()

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Returns
Type Description
LatLngOrBuilder

hasHigh()

public boolean hasHigh()

Required. The high point of the viewport.

.google.type.LatLng high = 2;

Returns
Type Description
boolean

Whether the high field is set.

hasLow()

public boolean hasLow()

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Returns
Type Description
boolean

Whether the low field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Viewport other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeHigh(LatLng value)

public Viewport.Builder mergeHigh(LatLng value)

Required. The high point of the viewport.

.google.type.LatLng high = 2;

Parameter
Name Description
value LatLng
Returns
Type Description
Viewport.Builder

mergeLow(LatLng value)

public Viewport.Builder mergeLow(LatLng value)

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Parameter
Name Description
value LatLng
Returns
Type Description
Viewport.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setField(Descriptors.FieldDescriptor field, Object value)

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

setHigh(LatLng value)

public Viewport.Builder setHigh(LatLng value)

Required. The high point of the viewport.

.google.type.LatLng high = 2;

Parameter
Name Description
value LatLng
Returns
Type Description
Viewport.Builder

setHigh(LatLng.Builder builderForValue)

public Viewport.Builder setHigh(LatLng.Builder builderForValue)

Required. The high point of the viewport.

.google.type.LatLng high = 2;

Parameter
Name Description
builderForValue LatLng.Builder
Returns
Type Description
Viewport.Builder

setLow(LatLng value)

public Viewport.Builder setLow(LatLng value)

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Parameter
Name Description
value LatLng
Returns
Type Description
Viewport.Builder

setLow(LatLng.Builder builderForValue)

public Viewport.Builder setLow(LatLng.Builder builderForValue)

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Parameter
Name Description
builderForValue LatLng.Builder
Returns
Type Description
Viewport.Builder

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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