3 import interfaces
.Constants
;
5 public class Response
implements Node
{
7 public static final int OK
= 200;
8 public static final int CREATED
= 201;
9 public static final int NO_CONTENT
= 204;
10 public static final int NOT_FOUND
= 404;
12 private final Constants type
;
13 private final int status
;
15 public Response(Constants type
, int status
) {
20 public Constants
type() {
28 public String
statusText() {
30 case OK
: return "200 OK";
31 case CREATED
: return "201 CREATED";
32 case NO_CONTENT
: return "204 NO CONTENT";
33 case NOT_FOUND
: return "404 NOT FOUND";
38 public void write(Writer writer
) {
39 writer
.appendInteger(Constants
.dmap_status
, status
);