Improved time prefix
This commit is contained in:
@ -4,9 +4,11 @@ import com.google.gson.JsonObject;
|
||||
|
||||
public class ConsoleOutput implements JSONOutput{
|
||||
private String message;
|
||||
private String time;
|
||||
|
||||
public ConsoleOutput(String message) {
|
||||
public ConsoleOutput(String message, String time) {
|
||||
this.message = message;
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -18,12 +20,17 @@ public class ConsoleOutput implements JSONOutput{
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toJSON() {
|
||||
JsonObject object = new JsonObject();
|
||||
object.addProperty("status", getStatusCode());
|
||||
object.addProperty("statusDescription", "Console Output");
|
||||
object.addProperty("time", getTime());
|
||||
object.addProperty("message", getMessage());
|
||||
return object.toString();
|
||||
}
|
||||
|
Reference in New Issue
Block a user