Package fi.moprim.tmd.sdk.trips.model
Interface Trip
-
- All Superinterfaces:
android.os.Parcelable
public interface Trip extends android.os.Parcelable
This interface to represent Trip. A trip is a collection of legs that belong to the same journey (i.e., the stationary periods are relatively short).
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description double
getCo2()
The co2 produced during this tripjava.lang.String
getDestination()
The destination of the tripdouble
getDistance()
The distance of the trip in metersdouble
getDuration()
TmdActivity
getLeg(int position)
java.util.List<TmdActivity>
getLegs()
Get the list of legs for this tripjava.lang.String
getMainMode()
MapData
getMapData()
java.lang.String
getMetadata()
The metadata for the tripjava.lang.String
getOrigin()
The name of the origin for the tripjava.lang.String
getPurpose()
The purpose for the tripjava.lang.String
getReason()
Deprecated.use instead @link{getPurpose}java.lang.String[]
getReasons()
The reasoning for this triplong
getTimestampEnd()
long
getTimestampStart()
boolean
hasLegs()
Check whether the trip has legsboolean
isCompleted()
This fields tells if the trip is completed and thus, may be not be modified without the user's inputboolean
isValidated()
This field is important for reportingstatic java.lang.String
marshall(Trip trip)
static boolean
sameTrip(Trip first, Trip second)
static boolean
sameTrips(java.util.List<Trip> first, java.util.List<Trip> second)
int
size()
The size of the tripstatic Trip
unmarshall(java.lang.String trip)
-
-
-
Field Detail
-
EMPTY
static final Trip EMPTY
-
-
Method Detail
-
getTimestampStart
long getTimestampStart()
- Returns:
- the UTC timestamp (in ms) of the start of the TMD trip
-
getTimestampEnd
long getTimestampEnd()
- Returns:
- the UTC timestamp (in ms) of the end of the TMD trip
-
getDuration
double getDuration()
- Returns:
- the duration in seconds of the trip
-
hasLegs
boolean hasLegs()
Check whether the trip has legs- Returns:
- true if the trip has legs, false otherwise
-
size
int size()
The size of the trip- Returns:
- the number of legs in the trip
-
getLegs
java.util.List<TmdActivity> getLegs()
Get the list of legs for this trip- Returns:
- the list of legs for this trip
-
getLeg
TmdActivity getLeg(int position)
-
getMainMode
java.lang.String getMainMode()
- Returns:
- the main mode of the trip
-
getDistance
double getDistance()
The distance of the trip in meters- Returns:
- the distance of the trip
-
getCo2
double getCo2()
The co2 produced during this trip- Returns:
- the co2 produced in grams
-
getOrigin
java.lang.String getOrigin()
The name of the origin for the trip- Returns:
- the origin of the trip
-
getDestination
java.lang.String getDestination()
The destination of the trip- Returns:
- the destination
-
getReason
@Deprecated java.lang.String getReason()
Deprecated.use instead @link{getPurpose}The reason for the trip- Returns:
- the reason for the trip
-
getPurpose
java.lang.String getPurpose()
The purpose for the trip- Returns:
- the purpose for the trip
-
getReasons
java.lang.String[] getReasons()
The reasoning for this trip- Returns:
- the list of reason for combining these modes
-
getMetadata
java.lang.String getMetadata()
The metadata for the trip- Returns:
- the metadata for the trip
-
isValidated
boolean isValidated()
This field is important for reporting- Returns:
- true if the trip has been validated by the user
-
isCompleted
boolean isCompleted()
This fields tells if the trip is completed and thus, may be not be modified without the user's input- Returns:
- true if the trip is completed.
-
getMapData
MapData getMapData()
-
sameTrips
static boolean sameTrips(@NonNull java.util.List<Trip> first, @NonNull java.util.List<Trip> second)
-
unmarshall
static Trip unmarshall(java.lang.String trip)
-
marshall
static java.lang.String marshall(Trip trip)
-
-