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
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public Viewport.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
build()
Returns
buildPartial()
public Viewport buildPartial()
Returns
clear()
public Viewport.Builder clear()
Returns
Overrides
clearField(Descriptors.FieldDescriptor field)
public Viewport.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
clearHigh()
public Viewport.Builder clearHigh()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Returns
clearLow()
public Viewport.Builder clearLow()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Returns
clearOneof(Descriptors.OneofDescriptor oneof)
public Viewport.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
Overrides
clone()
public Viewport.Builder clone()
Returns
Overrides
getDefaultInstanceForType()
public Viewport getDefaultInstanceForType()
Returns
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns
Overrides
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
getHighOrBuilder()
public LatLngOrBuilder getHighOrBuilder()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Returns
getLow()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Returns
getLowBuilder()
public LatLng.Builder getLowBuilder()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Returns
getLowOrBuilder()
public LatLngOrBuilder getLowOrBuilder()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Returns
hasHigh()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Returns
Type | Description |
boolean | Whether the high field is set.
|
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
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
mergeFrom(Viewport other)
public Viewport.Builder mergeFrom(Viewport other)
Parameter
Returns
public Viewport.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
mergeFrom(Message other)
public Viewport.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
mergeHigh(LatLng value)
public Viewport.Builder mergeHigh(LatLng value)
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Parameter
Returns
mergeLow(LatLng value)
public Viewport.Builder mergeLow(LatLng value)
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Parameter
Returns
mergeUnknownFields(UnknownFieldSet unknownFields)
public final Viewport.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides
setField(Descriptors.FieldDescriptor field, Object value)
public Viewport.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
setHigh(LatLng value)
public Viewport.Builder setHigh(LatLng value)
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Parameter
Returns
setHigh(LatLng.Builder builderForValue)
public Viewport.Builder setHigh(LatLng.Builder builderForValue)
Required. The high point of the viewport.
.google.type.LatLng high = 2;
Parameter
Returns
setLow(LatLng value)
public Viewport.Builder setLow(LatLng value)
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Parameter
Returns
setLow(LatLng.Builder builderForValue)
public Viewport.Builder setLow(LatLng.Builder builderForValue)
Required. The low point of the viewport.
.google.type.LatLng low = 1;
Parameter
Returns
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public Viewport.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final Viewport.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides