Improved time prefix

This commit is contained in:
Carlos
2020-05-29 16:37:35 +02:00
parent a5335b1e6e
commit 2643999e8d
9 changed files with 46 additions and 25 deletions

View File

@ -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();
}