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(WebException error)
Failure response with exception
|
io.vertx.ext.web.Session |
getSession() |
io.vertx.core.MultiMap |
headers() |
String |
identifier(String field)
Read user's identifier
|
static Envelop |
ok()
Empty content success
|
String |
response()
Convert to response
|
void |
setContext(Map<String,Object> data) |
void |
setHeaders(io.vertx.core.MultiMap headers) |
void |
setSession(io.vertx.ext.web.Session session) |
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(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 response()
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)
Copyright © 2018. All rights reserved.