From 46a040d6ff07e2581ae461ac60d2abc736cc7c6d Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Sat, 26 Nov 2016 04:17:17 +0700 Subject: status constants --- .../src/main/java/com/juick/server/helpers/Status.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'juick-server/src') diff --git a/juick-server/src/main/java/com/juick/server/helpers/Status.java b/juick-server/src/main/java/com/juick/server/helpers/Status.java index f68baae5..3c344193 100644 --- a/juick-server/src/main/java/com/juick/server/helpers/Status.java +++ b/juick-server/src/main/java/com/juick/server/helpers/Status.java @@ -6,9 +6,17 @@ import com.fasterxml.jackson.annotation.JsonProperty; * Created by vitalyster on 25.07.2016. */ public class Status { - private String value; + private final String value; - public Status(String value) { + public static final Status OK = new Status("ok"); + public static final Status FAIL = new Status("Fail"); + public static final Status ERROR = new Status("Error"); + + public static Status getStatus(final String stringStatus) { + return new Status(stringStatus); + } + + private Status(String value) { this.value = value; } @@ -16,4 +24,9 @@ public class Status { public String getValue() { return value; } + + @Override + public String toString() { + return "value = " + value; + } } -- cgit v1.2.3