org.starhope.appius.messaging
Class Message

java.lang.Object
  extended by BaseDatum
      extended by org.starhope.appius.messaging.Message

public class Message
extends BaseDatum

Author:
brpocock

Nested Class Summary
static class Message.Delivery
          The means/method of delivery for this message.
 
Field Summary
private  String body
          The body (content) of the message
private  Message.Delivery delivery
          The means by which the message was (intended to be) delivered.
private  Person from
          The user sending/originating the message
private  Date read
          The date and time at which the message was read; or, null if it has not yet been read.
private  Date sent
          The date and time at which the message was sent.
private static long serialVersionUID
           
private  Person to
          The user who is the intended recipient of the message.
 
Constructor Summary
Message()
           
 
Method Summary
static Message get(InternalEventObject ieo)
           
static Message get(org.json.JSONObject obj)
           
 String getBody()
           
 Message.Delivery getDelivery()
           
 Person getFrom()
           
 Date getRead()
           
 Date getSent()
           
 Person getTo()
           
 boolean isRead()
           
 void set(org.json.JSONObject o)
           
 void setBody(String body)
           
 void setDelivery(Message.Delivery delivery)
           
 void setFrom(Person from)
           
 void setRead(Date read)
           
 void setSent(Date sent)
           
 void setTo(Person to)
           
 org.json.JSONObject toJSON()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

body

private String body
The body (content) of the message


delivery

private Message.Delivery delivery
The means by which the message was (intended to be) delivered.


from

private Person from
The user sending/originating the message


read

private Date read
The date and time at which the message was read; or, null if it has not yet been read.


sent

private Date sent
The date and time at which the message was sent.


to

private Person to
The user who is the intended recipient of the message.

Constructor Detail

Message

public Message()
Method Detail

get

public static Message get(org.json.JSONObject obj)
                   throws RuntimeException,
                          NotFoundException,
                          org.json.JSONException
Parameters:
obj - the JSON data describing a Message
Returns:
a Message object describing the same Message
Throws:
RuntimeException - RuntimeException
NotFoundException - NotFoundException
org.json.JSONException - JSONException

get

public static Message get(InternalEventObject ieo)
Parameters:
ieo - The Smart Fox Server InternalEventObject describing a chat message
Returns:
a Message object describing that event

getBody

public String getBody()
Returns:
the body

getDelivery

public Message.Delivery getDelivery()
Returns:
the delivery

getFrom

public Person getFrom()
Returns:
the from

getRead

public Date getRead()
Returns:
the read

getSent

public Date getSent()
Returns:
the sent

getTo

public Person getTo()
Returns:
the to

isRead

public boolean isRead()
Returns:
whether this message has been read

set

public void set(org.json.JSONObject o)
See Also:
org.starhope.appius.util.BaseDatum#set(org.json.JSONObject)

setBody

public void setBody(String body)
Parameters:
body - the body to set

setDelivery

public void setDelivery(Message.Delivery delivery)
Parameters:
delivery - the delivery to set

setFrom

public void setFrom(Person from)
Parameters:
from - the from to set

setRead

public void setRead(Date read)
Parameters:
read - the read to set

setSent

public void setSent(Date sent)
Parameters:
sent - the sent to set

setTo

public void setTo(Person to)
Parameters:
to - the to to set

toJSON

public org.json.JSONObject toJSON()
See Also:
org.starhope.appius.util.BaseDatum#toJSON()