Package com.google.geo.type
Class Viewport.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite.Builder<Viewport,Viewport.Builder>
com.google.geo.type.Viewport.Builder
- All Implemented Interfaces:
ViewportOrBuilder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,Cloneable
- Enclosing class:
- Viewport
public static final class Viewport.Builder
extends com.google.protobuf.GeneratedMessageLite.Builder<Viewport,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-
Field Summary
Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder
instance -
Method Summary
Modifier and TypeMethodDescriptionRequired.clearLow()Required.getHigh()Required.getLow()Required.booleanhasHigh()Required.booleanhasLow()Required.Required.Required.Required.setHigh(LatLng.Builder builderForValue) Required.Required.setLow(LatLng.Builder builderForValue) Required.Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder
build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFromMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
Method Details
-
hasLow
public boolean hasLow()Required. The low point of the viewport.
.google.type.LatLng low = 1 [json_name = "low"];- Specified by:
hasLowin interfaceViewportOrBuilder- Returns:
- Whether the low field is set.
-
getLow
Required. The low point of the viewport.
.google.type.LatLng low = 1 [json_name = "low"];- Specified by:
getLowin interfaceViewportOrBuilder- Returns:
- The low.
-
setLow
Required. The low point of the viewport.
.google.type.LatLng low = 1 [json_name = "low"]; -
setLow
Required. The low point of the viewport.
.google.type.LatLng low = 1 [json_name = "low"]; -
mergeLow
Required. The low point of the viewport.
.google.type.LatLng low = 1 [json_name = "low"]; -
clearLow
Required. The low point of the viewport.
.google.type.LatLng low = 1 [json_name = "low"]; -
hasHigh
public boolean hasHigh()Required. The high point of the viewport.
.google.type.LatLng high = 2 [json_name = "high"];- Specified by:
hasHighin interfaceViewportOrBuilder- Returns:
- Whether the high field is set.
-
getHigh
Required. The high point of the viewport.
.google.type.LatLng high = 2 [json_name = "high"];- Specified by:
getHighin interfaceViewportOrBuilder- Returns:
- The high.
-
setHigh
Required. The high point of the viewport.
.google.type.LatLng high = 2 [json_name = "high"]; -
setHigh
Required. The high point of the viewport.
.google.type.LatLng high = 2 [json_name = "high"]; -
mergeHigh
Required. The high point of the viewport.
.google.type.LatLng high = 2 [json_name = "high"]; -
clearHigh
Required. The high point of the viewport.
.google.type.LatLng high = 2 [json_name = "high"];
-