public class

TmdUploadMetadata

extends Object
implements Parcelable
java.lang.Object
   ↳ fi.moprim.tmd.sdk.model.TmdUploadMetadata

Class Overview

A class that summarizes the results of an upload

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator CREATOR
Public Constructors
TmdUploadMetadata(long uploadTimestamp, int nbTmdActivities, long lastTmdActivityTimestamp, int nbLocations, long lastLocationTimestamp)
Default constructor
TmdUploadMetadata()
Default constructor when nothing was set
TmdUploadMetadata(Parcel in)
Parcel constructor
Public Methods
boolean dataWasUploaded()
Check if some data (TMD or Location) was uploaded
int describeContents()
static Result<TmdUploadMetadata> extractResult(Intent intent)
Extract the result embedded in the intent
long getLastTimestampOfLocationUploaded()
Get the timestamp of the last location point that was just uploaded
long getLastTimestampOfTmdActivityUploaded()
Get the end timestamp of last activity that was just uploaded
int getNbLocationsUploaded()
Get the number of location data points that were uploaded
int getNbTmdActivitiesUploaded()
Get the number of tmd activities that were just uploaded
long getUploadTimestamp()
Get the upload timestamp of the last upload
static boolean hasResult(Intent intent)
Check from an intent if it includes TMD_UPLOAD_METADATA
String toString()
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator CREATOR

Public Constructors

public TmdUploadMetadata (long uploadTimestamp, int nbTmdActivities, long lastTmdActivityTimestamp, int nbLocations, long lastLocationTimestamp)

Default constructor

Parameters
uploadTimestamp The upload timestamp of the last upload
nbTmdActivities The number of tmd activities that were just uploaded
lastTmdActivityTimestamp The end timestamp of last activity that was just uploaded
nbLocations The number of location data points that were uploaded
lastLocationTimestamp The timestamp of the last location point that was just uploaded

public TmdUploadMetadata ()

Default constructor when nothing was set

public TmdUploadMetadata (Parcel in)

Parcel constructor

Parameters
in the parcel

Public Methods

public boolean dataWasUploaded ()

Check if some data (TMD or Location) was uploaded

Returns
  • true if getNbLocationsUploaded() + getNbTmdActivitiesUploaded() > 0

public int describeContents ()

public static Result<TmdUploadMetadata> extractResult (Intent intent)

Extract the result embedded in the intent

Parameters
intent the intent
Returns
  • the result that was extracted from the intent extras

public long getLastTimestampOfLocationUploaded ()

Get the timestamp of the last location point that was just uploaded

Returns
  • the timestamp of the last location point that was just uploaded

public long getLastTimestampOfTmdActivityUploaded ()

Get the end timestamp of last activity that was just uploaded

Returns
  • the end timestamp of last activity that was just uploaded

public int getNbLocationsUploaded ()

Get the number of location data points that were uploaded

Returns
  • the number of location data points that were uploaded

public int getNbTmdActivitiesUploaded ()

Get the number of tmd activities that were just uploaded

Returns
  • the number of tmd activities that were just uploaded

public long getUploadTimestamp ()

Get the upload timestamp of the last upload

Returns

public static boolean hasResult (Intent intent)

Check from an intent if it includes TMD_UPLOAD_METADATA

Parameters
intent the intent to check
Returns
  • true if it embed a TmdUpdateMetadata result

public String toString ()

public void writeToParcel (Parcel dest, int flags)