public class Location<T extends Location<T>> extends Object implements Validatable
Location.
In its minimal form it only contains a coordinate point.
| Constructor and Description |
|---|
Location() |
| Modifier and Type | Method and Description |
|---|---|
static Location<?> |
createMinimal(GeoJSONCoordinate position) |
boolean |
equals(Object obj) |
Map<String,Object> |
getAdditionalInfo() |
Optional<Address> |
getAddress() |
Optional<GeoJSONFeature<?>> |
getComplexGeometry()
Get the real / complex geometry (e.g.
|
GeoJSONFeature<GeoJSONPoint> |
getCoordinate()
Get a point representing this
Location. |
GeoJSONCoordinate |
getSimpleCoordinate()
Convenience getter for the actual coordinate wrapped in the GeoJSON
feature
|
int |
hashCode() |
T |
setAdditionalInfo(Map<String,Object> additionalInfo) |
T |
setAddress(Address address) |
T |
setComplexGeometry(GeoJSONFeature<?> complexGeometry) |
T |
setCoordinate(GeoJSONCoordinate coordinate) |
T |
setCoordinate(GeoJSONFeature<GeoJSONPoint> coordinate) |
String |
toString() |
void |
validate()
Checks if the instance is in a valid / useful state.
|
public GeoJSONCoordinate getSimpleCoordinate()
NullPointerException - in case the Location's point feature did not contain
a coordinatepublic GeoJSONFeature<GeoJSONPoint> getCoordinate()
Location. This information is
mandatory and also available for more complex locations, e.g. for a
PointOfInterest polygon (see getComplexGeometry()) of a
building.
In case this Location is part of a RoutingRequest
(from/to/via) this point is used as input for routing.
public Optional<GeoJSONFeature<?>> getComplexGeometry()
getCoordinate() is not detailed enough.public T setCoordinate(GeoJSONFeature<GeoJSONPoint> coordinate)
public T setCoordinate(GeoJSONCoordinate coordinate)
public T setComplexGeometry(GeoJSONFeature<?> complexGeometry)
public static Location<?> createMinimal(GeoJSONCoordinate position)
public void validate()
ValidatableIllegalArgumentException including a description of the
invalid state is thrown.validate in interface ValidatableCopyright © 2018. All rights reserved.