Package fi.moprim.tmd.sdk.trips.model
Interface Trip
-
- All Superinterfaces:
android.os.Parcelable
public interface Trip extends android.os.ParcelableThis 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 doublegetCo2()The co2 produced during this tripjava.lang.StringgetDestination()The destination of the tripdoublegetDistance()The distance of the trip in metersdoublegetDuration()TmdActivitygetLeg(int position)java.util.List<TmdActivity>getLegs()Get the list of legs for this tripjava.lang.StringgetMainMode()MapDatagetMapData()java.lang.StringgetMetadata()The metadata for the tripjava.lang.StringgetOrigin()The name of the origin for the tripjava.lang.StringgetPurpose()The purpose for the tripjava.lang.StringgetReason()Deprecated.use instead @link{getPurpose}java.lang.String[]getReasons()The reasoning for this triplonggetTimestampEnd()longgetTimestampStart()booleanhasLegs()Check whether the trip has legsbooleanisCompleted()This fields tells if the trip is completed and thus, may be not be modified without the user's inputbooleanisValidated()This field is important for reportingstatic java.lang.Stringmarshall(Trip trip)static booleansameTrip(Trip first, Trip second)static booleansameTrips(java.util.List<Trip> first, java.util.List<Trip> second)intsize()The size of the tripstatic Tripunmarshall(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)
-
-