public class ResponseStatusConverter extends Object
Helper class to easily convert different handler status types to a common one.
Modifier and Type | Field and Description |
---|---|
static int |
HTTP_ACCEPTED |
static int |
HTTP_BAD_REQUEST |
static int |
HTTP_CREATED |
static int |
HTTP_INTERNAL_ERROR |
static int |
HTTP_NOT_FOUND |
static int |
HTTP_OK |
Constructor and Description |
---|
ResponseStatusConverter() |
Modifier and Type | Method and Description |
---|---|
static ResponseStatus |
fromBinary(short code)
Convert the binary protocol status in a typesafe enum that can be acted upon later.
|
static ResponseStatus |
fromHttp(int code)
Convert the http protocol status in a typesafe enum that can be acted upon later.
|
public static final int HTTP_OK
public static final int HTTP_CREATED
public static final int HTTP_ACCEPTED
public static final int HTTP_BAD_REQUEST
public static final int HTTP_NOT_FOUND
public static final int HTTP_INTERNAL_ERROR
public static ResponseStatus fromBinary(short code)
Convert the binary protocol status in a typesafe enum that can be acted upon later.
code
- the status to convert.public static ResponseStatus fromHttp(int code)
Convert the http protocol status in a typesafe enum that can be acted upon later.
code
- the status to convert.Copyright © 2015 Couchbase, Inc.. All rights reserved.