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
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public Viewport.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
build()
buildPartial()
public Viewport buildPartial()
clear()
public Viewport.Builder clear()
Overrides
clearField(Descriptors.FieldDescriptor field)
public Viewport.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
clearHigh()
public Viewport.Builder clearHigh()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
clearLow()
public Viewport.Builder clearLow()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
clearOneof(Descriptors.OneofDescriptor oneof)
public Viewport.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
clone()
public Viewport.Builder clone()
Overrides
getDefaultInstanceForType()
public Viewport getDefaultInstanceForType()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
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;
getHighOrBuilder()
public LatLngOrBuilder getHighOrBuilder()
Required. The high point of the viewport.
.google.type.LatLng high = 2;
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;
getLowOrBuilder()
public LatLngOrBuilder getLowOrBuilder()
Required. The low point of the viewport.
.google.type.LatLng low = 1;
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()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
mergeFrom(Viewport other)
public Viewport.Builder mergeFrom(Viewport other)
Parameter |
Name |
Description |
other |
Viewport
|
public Viewport.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public Viewport.Builder mergeFrom(Message other)
Parameter |
Name |
Description |
other |
Message
|
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
|
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
|
mergeUnknownFields(UnknownFieldSet unknownFields)
public final Viewport.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
setField(Descriptors.FieldDescriptor field, Object value)
public Viewport.Builder setField(Descriptors.FieldDescriptor field, Object value)
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
|
setHigh(LatLng.Builder builderForValue)
public Viewport.Builder setHigh(LatLng.Builder builderForValue)
Required. The high point of the viewport.
.google.type.LatLng high = 2;
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
|
setLow(LatLng.Builder builderForValue)
public Viewport.Builder setLow(LatLng.Builder builderForValue)
Required. The low point of the viewport.
.google.type.LatLng low = 1;
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public Viewport.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final Viewport.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides