public class Envelop extends Object implements Serializable
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
context() |
<T> T |
context(String key,
Class<T> clazz)
Extract data from context
|
<T> T |
data()
Extract data port to T
|
<T> T |
data(Class<T> clazz)
Extract request part to t
|
<T> T |
data(Integer argIndex,
Class<T> clazz)
Extract request part to t ( Direct Mode )
|
static Envelop |
failure(String message) |
static Envelop |
failure(io.vertx.up.exception.WebException error)
Failure response with exception
|
io.vertx.core.http.HttpMethod |
getMethod() |
io.vertx.ext.web.Session |
getSession() |
String |
getUri() |
io.vertx.core.MultiMap |
headers() |
String |
identifier(String field)
Read user's identifier
|
String |
key() |
Envelop |
key(String key) |
static Envelop |
ok()
Empty content success
|
io.vertx.core.buffer.Buffer |
responseBuffer() |
io.vertx.core.json.JsonObject |
responseJson() |
String |
responseString()
Convert to response
|
void |
setContext(Map<String,Object> data) |
void |
setHeaders(io.vertx.core.MultiMap headers) |
void |
setMethod(io.vertx.core.http.HttpMethod method) |
void |
setSession(io.vertx.ext.web.Session session) |
void |
setUri(String uri) |
void |
setUser(io.vertx.ext.auth.User user) |
void |
setValue(Integer argIndex,
String field,
Object value) |
void |
setValue(String field,
Object value) |
io.vertx.core.http.HttpStatusCode |
status() |
static <T> Envelop |
success(T entity) |
static <T> Envelop |
success(T entity,
io.vertx.core.http.HttpStatusCode status) |
io.vertx.core.Future<Envelop> |
toFuture() |
String |
toString() |
io.vertx.ext.auth.User |
user() |
boolean |
valid()
Whether this envelop is valid.
|
public static Envelop ok()
public static <T> Envelop success(T entity)
public static <T> Envelop success(T entity, io.vertx.core.http.HttpStatusCode status)
public static Envelop failure(io.vertx.up.exception.WebException error)
error - public boolean valid()
public <T> T data()
public <T> T data(Class<T> clazz)
T - clazz - public <T> T context(String key, Class<T> clazz)
T - clazz - public <T> T data(Integer argIndex, Class<T> clazz)
T - argIndex - public String responseString()
public io.vertx.core.json.JsonObject responseJson()
public io.vertx.core.buffer.Buffer responseBuffer()
public io.vertx.core.Future<Envelop> toFuture()
public io.vertx.core.http.HttpStatusCode status()
public io.vertx.ext.auth.User user()
public io.vertx.core.MultiMap headers()
public void setUser(io.vertx.ext.auth.User user)
public void setHeaders(io.vertx.core.MultiMap headers)
public io.vertx.ext.web.Session getSession()
public void setSession(io.vertx.ext.web.Session session)
public String getUri()
public void setUri(String uri)
public io.vertx.core.http.HttpMethod getMethod()
public void setMethod(io.vertx.core.http.HttpMethod method)
public String key()
Copyright © 2019. All rights reserved.