Package com.targomo.client.api.geo
Class DefaultSourceCoordinate
java.lang.Object
com.targomo.client.api.geo.AbstractLocation
com.targomo.client.api.geo.AbstractCoordinate
com.targomo.client.api.geo.DefaultSourceCoordinate
- All Implemented Interfaces:
Coordinate,Location
Default implementation for storing source coordinates.
Basically a
AbstractCoordinate with TravelType, specialized to be used as a target.-
Field Summary
Fields inherited from class com.targomo.client.api.geo.AbstractLocation
id, properties -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSourceCoordinate(String id, double x, double y) Generate Source coordinate with ID, X and Y values with no travel type.DefaultSourceCoordinate(String id, double x, double y, TravelType travelType) Generate Source coordinate with a TravelType as well as ID, X and Y values.DefaultSourceCoordinate(String id, double x, double y, TravelType travelType, LocationProperties locationProperties) Generate Source coordinate with a TravelType as well as ID, X and Y values.DefaultSourceCoordinate(String id, double x, double y, LocationProperties locationProperties) Generate Source coordinate with ID, X and Y values with no travel type.DefaultSourceCoordinate(String id, double x, double y, List<TravelType> travelTypes, LocationProperties locationProperties) -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongThe main problem with this identifier is that we need it for hibernate since it's not able to work without an ID.inthashCode()voidsetIdentifier(long id) toString()Returns a JSON String representation of the Coordinate with ID, x and y values.Methods inherited from class com.targomo.client.api.geo.AbstractCoordinate
getX, getY, setTravelType, setX, setYMethods inherited from class com.targomo.client.api.geo.AbstractLocation
getId, getProperties, setId, setPropertiesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.targomo.client.api.geo.Location
getId, getProperties, getTravelTypes, setId, setProperties, setTravelTypes
-
Constructor Details
-
DefaultSourceCoordinate
public DefaultSourceCoordinate() -
DefaultSourceCoordinate
public DefaultSourceCoordinate(String id, double x, double y, List<TravelType> travelTypes, LocationProperties locationProperties) -
DefaultSourceCoordinate
public DefaultSourceCoordinate(String id, double x, double y, TravelType travelType, LocationProperties locationProperties) Generate Source coordinate with a TravelType as well as ID, X and Y values.- Parameters:
id- ID to associate with the target coordinatex- X value of targety- Y value of targettravelType- TravelType to be associated with the coordinatelocationProperties- properties for this source
-
DefaultSourceCoordinate
Generate Source coordinate with a TravelType as well as ID, X and Y values.- Parameters:
id- ID to associate with the target coordinatex- X value of targety- Y value of targettravelType- TravelType to be associated with the coordinate
-
DefaultSourceCoordinate
Generate Source coordinate with ID, X and Y values with no travel type. Travel type will be set to null.- Parameters:
id- ID to associate with the target coordinatex- X value of targety- Y value of target
-
DefaultSourceCoordinate
public DefaultSourceCoordinate(String id, double x, double y, LocationProperties locationProperties) Generate Source coordinate with ID, X and Y values with no travel type. Travel type will be set to null.- Parameters:
id- ID to associate with the target coordinatex- X value of targety- Y value of targetlocationProperties-
-
-
Method Details
-
getIdentifier
public long getIdentifier()The main problem with this identifier is that we need it for hibernate since it's not able to work without an ID. But source coordinates have perse no real identifier since the same coordinate could come from multiple clients and have different lat/lng/traveltype.- Returns:
- this database unique identifier of this source point
-
setIdentifier
public void setIdentifier(long id) -
toString
Description copied from class:AbstractCoordinateReturns a JSON String representation of the Coordinate with ID, x and y values.- Overrides:
toStringin classAbstractCoordinate- Returns:
- JSON representation of the coordinate
-
equals
- Overrides:
equalsin classAbstractCoordinate
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractCoordinate
-