Class Viewport.Builder (2.10.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Viewport build()
Returns
TypeDescription
Viewport

buildPartial()

public Viewport buildPartial()
Returns
TypeDescription
Viewport

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearHigh()

public Viewport.Builder clearHigh()

Required. The high point of the viewport.

.google.type.LatLng high = 2;

Returns
TypeDescription
Viewport.Builder

clearLow()

public Viewport.Builder clearLow()

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Returns
TypeDescription
Viewport.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

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

getDefaultInstanceForType()

public Viewport getDefaultInstanceForType()
Returns
TypeDescription
Viewport

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getHigh()

public LatLng getHigh()

Required. The high point of the viewport.

.google.type.LatLng high = 2;

Returns
TypeDescription
LatLng

The high.

getHighBuilder()

public LatLng.Builder getHighBuilder()

Required. The high point of the viewport.

.google.type.LatLng high = 2;

Returns
TypeDescription
LatLng.Builder

getHighOrBuilder()

public LatLngOrBuilder getHighOrBuilder()

Required. The high point of the viewport.

.google.type.LatLng high = 2;

Returns
TypeDescription
LatLngOrBuilder

getLow()

public LatLng getLow()

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Returns
TypeDescription
LatLng

The low.

getLowBuilder()

public LatLng.Builder getLowBuilder()

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Returns
TypeDescription
LatLng.Builder

getLowOrBuilder()

public LatLngOrBuilder getLowOrBuilder()

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Returns
TypeDescription
LatLngOrBuilder

hasHigh()

public boolean hasHigh()

Required. The high point of the viewport.

.google.type.LatLng high = 2;

Returns
TypeDescription
boolean

Whether the high field is set.

hasLow()

public boolean hasLow()

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Returns
TypeDescription
boolean

Whether the low field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Viewport other)

public Viewport.Builder mergeFrom(Viewport other)
Parameter
NameDescription
otherViewport
Returns
TypeDescription
Viewport.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

public Viewport.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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
NameDescription
valueLatLng
Returns
TypeDescription
Viewport.Builder

mergeLow(LatLng value)

public Viewport.Builder mergeLow(LatLng value)

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Parameter
NameDescription
valueLatLng
Returns
TypeDescription
Viewport.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setField(Descriptors.FieldDescriptor field, Object value)

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

setLow(LatLng value)

public Viewport.Builder setLow(LatLng value)

Required. The low point of the viewport.

.google.type.LatLng low = 1;

Parameter
NameDescription
valueLatLng
Returns
TypeDescription
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
NameDescription
builderForValueLatLng.Builder
Returns
TypeDescription
Viewport.Builder

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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