Cortex Android
 All Classes Namespaces Functions Variables
nl.sense_os.cortex.coaching.Message Class Reference

Classes

enum  STYLE
 
enum  TYPE
 

Public Member Functions

 Message (JSONObject message)
 
String getTitle ()
 
String getText ()
 
String getNotificationText ()
 
Coach.TYPE getCoachType ()
 
Task.TYPE getTaskType ()
 
double getTaskStartTime ()
 
double getGenerationTime ()
 
double getTriggerTime ()
 
Message.TYPE getMsgType ()
 
JSONObject getValue ()
 
JSONObject getTarget ()
 
Message.STYLE getStyle ()
 
int getStyleMsgId ()
 
int getadviceId ()
 
JSONObject toJSONObject ()
 
String toString ()
 

Static Public Member Functions

static Message getDummyMessage ()
 

Protected Member Functions

void setValue (JSONObject value)
 
void setGenerationTime (double time)
 
void setTriggerTime (double time)
 
void setadviceId (int adviceId)
 
void setTaskStartTime (double taskStartTime)
 
void setNotificationText (String notificationText)
 
void setTitle (String title)
 
void setText (String text)
 
void setTaskType (Task.TYPE taskType)
 
void setCoachType (Coach.TYPE coachType)
 
void setStyleMsgId (int styleMsgId)
 
void setMsgType (Message.TYPE msgType)
 
void setTarget (JSONObject target)
 
void setStyle (Message.STYLE style)
 

Constructor & Destructor Documentation

nl.sense_os.cortex.coaching.Message.Message ( JSONObject  message)

Construct Message from JSONObject

This function constructs a Message from a JSONObject.
The JSONObject should contain the data members as key-value pair

Parameters
messageThe Message represented as a JSONObject

Member Function Documentation

int nl.sense_os.cortex.coaching.Message.getadviceId ( )

Get advice id

The identifier for the advice used to fill the title, notification and text of the message

Returns
The advice id or -1 when no advice id is available.
Coach.TYPE nl.sense_os.cortex.coaching.Message.getCoachType ( )

Get the Coach type

The type of the Coach that generated the task.

Returns
The COACH_TYPE of the associated Coach
static Message nl.sense_os.cortex.coaching.Message.getDummyMessage ( )
static

Get a dummy Message

Get an example Message with unrealistic values.

Returns
The dummy Message
double nl.sense_os.cortex.coaching.Message.getGenerationTime ( )

Get the generation time

The generation time of the message.

Returns
The epoch time in seconds
Message.TYPE nl.sense_os.cortex.coaching.Message.getMsgType ( )

Get the Message type

The reason why a task was triggered

Returns
The type of the message
String nl.sense_os.cortex.coaching.Message.getNotificationText ( )

Get the notification text

Notification text version of the message.

Returns
The notification text of the message
Message.STYLE nl.sense_os.cortex.coaching.Message.getStyle ( )

Get the Message style

The personality based style used for the message

Returns
The style of the message by default the first style is selected.
int nl.sense_os.cortex.coaching.Message.getStyleMsgId ( )

Get the style message id

The identifier of the style message used to fill the title, notification and text of the message

Returns
The style message id or -1 when no style msg id is available
JSONObject nl.sense_os.cortex.coaching.Message.getTarget ( )

Get the Task target value

The target value of the Task. The returning JSONObject has one key: "value".
value: can contain any of the possible JSON values, but is often a double.
The JSONObject will be null if there is no value.

@return The target value of the Task
double nl.sense_os.cortex.coaching.Message.getTaskStartTime ( )

Get the start time of the Task

The time at which the task generating this message has started.

Returns
The epoch time in seconds
Task.TYPE nl.sense_os.cortex.coaching.Message.getTaskType ( )

Get the Task type

The type of the Task this message was generated by.

Returns
The type of the Task
String nl.sense_os.cortex.coaching.Message.getText ( )

Get the Text

Full text version of the message.

Returns
The text of the message
String nl.sense_os.cortex.coaching.Message.getTitle ( )

Get the Title

Very short version of the message (+- 5 words).

Returns
The title of the message
double nl.sense_os.cortex.coaching.Message.getTriggerTime ( )

Get the trigger time

The time specified by the trigger that caused this message to be created.

Returns
The epoch time in seconds
JSONObject nl.sense_os.cortex.coaching.Message.getValue ( )

Get the Task value

Get the value of the task at the moment of triggering.
The returning JSONObject has two keys: "value" and "date".
value: can contain any of the possible JSON values, but is often a double.
date: the date of the value in epoch time seconds.
The JSONObject will be null if there is no current value.

@return The Task value
JSONObject nl.sense_os.cortex.coaching.Message.toJSONObject ( )

Get the JSONObject representation

Converts the Message into a JSONObject

Returns
The JSONObject representation
String nl.sense_os.cortex.coaching.Message.toString ( )

The JSON String representation

Returns an indented JSON formated String representation of the Message

Returns
The JSON formated String representation

The documentation for this class was generated from the following file: