|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ramblingwood.minecraft.jsonapi.api.JSONAPIStreamMessage
public abstract class JSONAPIStreamMessage
This class will need to be subcalled to provide meaningful data. By default, there are just some convenience methods. It is recommended that you call "setTime()" in your constructor to make sure the timestamp is as accurate as possible.
Constructor Summary | |
---|---|
JSONAPIStreamMessage()
|
Method Summary | |
---|---|
long |
getTime()
If setTime was previously called, returns the value setTime set. |
void |
setTime()
Takes a timestamp of the current time and stores it for usage later when the JSONObject is being created. |
void |
setTime(long time)
|
abstract java.lang.String |
streamName()
This return value of this method should be the same as the name of the stream when register it with JSONAPI. |
abstract org.json.simpleForBukkit.JSONObject |
toJSONObject()
Returns an org.json.simpleForBukkit.JSONObject that is a JSON representation of the data in this class. |
java.lang.String |
toJSONString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JSONAPIStreamMessage()
Method Detail |
---|
public abstract java.lang.String streamName()
public void setTime(long time)
public long getTime()
public void setTime()
public abstract org.json.simpleForBukkit.JSONObject toJSONObject()
JSONObject o = new JSONObject();
o.put("time", getTime());
o.put("player", getPlayer());
o.put("message", getMessage());
return o;
public java.lang.String toJSONString()
toJSONString
in interface org.json.simpleForBukkit.JSONAware
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |