Package es.situm.sdk.model.directions
Class RouteStep
- java.lang.Object
-
- es.situm.sdk.model.directions.RouteStep
-
- All Implemented Interfaces:
android.os.Parcelable
,es.situm.sdk.model.directions.graph.Edge<Point>
,MapperInterface
public class RouteStep extends java.lang.Object implements es.situm.sdk.model.directions.graph.Edge<Point>, android.os.Parcelable, MapperInterface
A fragment of a route, described by the initial pointfrom
and the last pointto
of the fragment, and some information about the step within the route.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RouteStep.Builder
RouteStep
builder static inner class.
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<RouteStep>
CREATOR
static RouteStep
EMPTY
static int
EMPTY_ID
-
Fields inherited from interface es.situm.sdk.model.MapperInterface
ACCESSIBILITY_MODE, ACCURACY, ADDRESS, ALTITUDE, BEARING, BEARING_FROM, BEARING_QUALITY, BOUNDS, BOUNDS_ROTATED, BUILDING, BUILDING_IDENTIFIER, BUILDING_NAME, CARTESIAN_BEARING, CARTESIAN_COORDINATE, CENTER, CLOSEST_LOCATION_IN_ROUTE, CODE, CONVERSION, COORDINATE, CREATED_AT, CURRENT_INDICATION, CURRENT_STEP_INDEX, CUSTOM_FIELDS, dateFormat, DEGREES, DEGREES_CLOCKWISE, DEVICE_ID, DIAGNOSTICS_OPTIONS_UPLOAD_DIAGNOSTICS_DATA, DIMENSIONS, DISTANCE, DISTANCE_TO_CHANGE_FLOOR_THRESHOLD, DISTANCE_TO_CHANGE_INDICATION_THRESHOLD, DISTANCE_TO_CLOSEST_POINT_IN_ROUTE, DISTANCE_TO_END_STEP, DISTANCE_TO_GOAL, DISTANCE_TO_GOAL_THRESHOLD, DISTANCE_TO_IGNORE_FIRST_INDICATION, DISTANCE_TO_NEXT_LEVEL, EDGES, EVENTS, EXCLUDED_TAGS, EXTERNAL_NAVIGATION_PAYLOAD, EXTERNAL_NAVIGATION_TYPE, FIRST_STEP, FLOOR, FLOOR_IDENTIFIER, FLOORS, FOREGROUND_SERVICE_NOTIFICATION_MESSAGE, FOREGROUND_SERVICE_NOTIFICATION_SHOW_STOP_ACTION, FOREGROUND_SERVICE_NOTIFICATION_STOP_ACTION_TEXT, FOREGROUND_SERVICE_NOTIFICATION_TAP_ACTION, FOREGROUND_SERVICE_NOTIFICATION_TITLE, FROM, GEOFENCES, HAS_BEARING, HAS_CARTESIAN_BEARING, HEIGHT, HUMAN_READABLE_MESSAGE, ID, IDENTIFIER, IGNORE_LOW_QUALITY_LOCATIONS, INCLUDED_TAGS, INDICATION_TYPE, INDICATIONS, INDICATIONS_INTERVAL, INDOOR_POIS, INFO_HTML, IS_FIRST, IS_INDOOR, IS_LAST, IS_OUTDOOR, IS_PUBLIC, LAST_STEP, LATITUDE, LONGITUDE, MAP_URL, MINIMIZE_FLOOR_CHANGES, NAME, NEEDED_LEVEL_CHANGE, NEXT_INDICATION, NEXT_LEVEL, NODES, NORTH_EAST, NORTH_WEST, ORIENTATION, ORIENTATION_TYPE, OUTDOOR_BUILDING_DETECTOR_BLE, OUTDOOR_POIS, OUTSIDE_ROUTE_THRESHOLD, PICTURE_THUMB_URL, PICTURE_URL, POI_CATEGORIES, POI_CATEGORY, POI_CATEGORY_CODE, POI_CATEGORY_ICON_SELECTED, POI_CATEGORY_ICON_UNSELECTED, POI_CATEGORY_IDENTIFIER, POI_CATEGORY_IDENTIFIERS, POI_CATEGORY_iNAME, POI_CATEGORY_NAME, POI_NAME, POI_TO, POI_TO_IDENTIFIER, POINTS, POLYGON_POINTS, POSITION, PROVIDER, QUALITY, RADIANS, RADIANS_MINUS_PI_PI, RADIUS, ROTATION, ROUND_INDICATIONS_STEP, ROUTE, ROUTE_STEP, SCALE, SEGMENTS, SOUTH_EAST, SOUTH_WEST, STATUS_NAME, STATUS_ORDINAL, STEP_IDX_DESTINATION, STEP_IDX_ORIGIN, STEPS, TIME_TO_END_STEP, TIME_TO_FIRST_INDICATION, TIME_TO_GOAL, TIME_TO_IGNORE_UNEXPECTED_FLOOR_CHANGES, TIMESTAMP, TO, TO_LEGACY, TRIGGER, UPDATED_AT, USER_IDENTIFIER, WIDTH, X, Y
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
describeContents()
boolean
equals(java.lang.Object o)
static RouteStep
fromMap(java.util.Map<java.lang.String,java.lang.Object> map)
java.lang.Double
getDistance()
java.lang.Double
getDistanceToFloorChange()
double
getDistanceToGoal()
Point
getFrom()
Start point of this step.int
getId()
Position of this RouteStep in the list of steps (Route.getSteps()
) of the route to which it belongs.java.util.List<java.lang.String>
getTags()
Point
getTo()
End point of this step.java.lang.Double
getWeight()
boolean
hasFloorChange()
Returns true if the floor changes in this step.int
hashCode()
boolean
isAccessible()
boolean
isFirst()
Returns true if this is the first step in the route.boolean
isLast()
Returns true if this is the last step in the route.java.lang.String
lookupKey()
void
setTags(java.util.List<java.lang.String> tags)
void
setWeight(java.lang.Double weight)
java.util.Map<java.lang.String,java.lang.Object>
toMap()
Method to transform object into Mapjava.lang.String
toString()
void
writeToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
EMPTY_ID
public static final int EMPTY_ID
- See Also:
- Constant Field Values
-
EMPTY
public static final RouteStep EMPTY
-
CREATOR
public static final android.os.Parcelable.Creator<RouteStep> CREATOR
-
-
Method Detail
-
getId
@IntRange(from=-1L) public int getId()
Position of this RouteStep in the list of steps (Route.getSteps()
) of the route to which it belongs. Also works as an unique identifier of this RouteStep in theRoute
.- Returns:
- -1 if this routeStep is not valid. Otherwise a valid position in the list of steps.
-
getFrom
@NonNull public Point getFrom()
Start point of this step.- Specified by:
getFrom
in interfacees.situm.sdk.model.directions.graph.Edge<Point>
- Returns:
- point in the route.
-
getTo
@NonNull public Point getTo()
End point of this step.- Specified by:
getTo
in interfacees.situm.sdk.model.directions.graph.Edge<Point>
- Returns:
- point in the route
-
getDistanceToGoal
@FloatRange(from=0.0) public double getDistanceToGoal()
Returns distance in meters between the start point of this step (getFrom()
) and the last point in the route (getTo()
of the last step).- Returns:
- meters.
-
getDistanceToFloorChange
@FloatRange(from=0.0) public java.lang.Double getDistanceToFloorChange()
Returns distance in meters between the start point of this step (getFrom()
) and the first point in the route (getFrom()
) of the next step which requires a floor change.- Returns:
- meters.
-
getDistance
@NonNull @FloatRange(from=0.0) public java.lang.Double getDistance()
- Specified by:
getDistance
in interfacees.situm.sdk.model.directions.graph.Edge<Point>
- Returns:
- meters.
-
getWeight
@NonNull public java.lang.Double getWeight()
- Specified by:
getWeight
in interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
setWeight
public void setWeight(@NonNull java.lang.Double weight)
- Specified by:
setWeight
in interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
setTags
public void setTags(@NonNull java.util.List<java.lang.String> tags)
- Specified by:
setTags
in interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
getTags
@NonNull public java.util.List<java.lang.String> getTags()
- Specified by:
getTags
in interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
isAccessible
public boolean isAccessible()
- Specified by:
isAccessible
in interfacees.situm.sdk.model.directions.graph.Edge<Point>
-
isFirst
public boolean isFirst()
Returns true if this is the first step in the route. False otherwise.- Returns:
- boolean
-
isLast
public boolean isLast()
Returns true if this is the last step in the route. False otherwise.- Returns:
- boolean
-
hasFloorChange
public boolean hasFloorChange()
Returns true if the floor changes in this step. False otherwise
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
lookupKey
public java.lang.String lookupKey()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
describeContents
public int describeContents()
- Specified by:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
toMap
public java.util.Map<java.lang.String,java.lang.Object> toMap()
Description copied from interface:MapperInterface
Method to transform object into Map- Specified by:
toMap
in interfaceMapperInterface
- Returns:
- Map
with the information of the object mapped
-
fromMap
public static RouteStep fromMap(java.util.Map<java.lang.String,java.lang.Object> map) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
-