T
- entity type.public final class Entity<T> extends Object
Modifier and Type | Method and Description |
---|---|
static <T> Entity<T> |
entity(T entity,
MediaType mediaType)
Create an entity using a supplied content media type.
|
static <T> Entity<T> |
entity(T entity,
MediaType mediaType,
Annotation[] annotations)
Create an entity using a supplied content media type.
|
static <T> Entity<T> |
entity(T entity,
String mediaType)
Create an entity using a supplied content media type.
|
static <T> Entity<T> |
entity(T entity,
Variant variant)
Create an entity using a supplied content media type.
|
static <T> Entity<T> |
entity(T entity,
Variant variant,
Annotation[] annotations)
Create an entity using a supplied content media type.
|
static Entity<Form> |
form(Form form)
Create an "application/x-www-form-urlencoded"
form entity.
|
static Entity<Form> |
form(MultivaluedMap<String,String> formData)
Create an "application/x-www-form-urlencoded"
form entity.
|
Annotation[] |
getAnnotations()
Get the entity annotations.
|
String |
getEncoding()
Get entity encoding.
|
T |
getEntity()
Get entity data.
|
Locale |
getLanguage()
Get entity language.
|
MediaType |
getMediaType()
Get entity media type.
|
Variant |
getVariant()
Get entity
variant information. |
static <T> Entity<T> |
html(T entity)
Create a "text/html" entity.
|
static <T> Entity<T> |
json(T entity)
Create an "application/json" entity.
|
static <T> Entity<T> |
text(T entity)
Create a "text/plain" entity.
|
static <T> Entity<T> |
xhtml(T entity)
Create an "application/xhtml+xml" entity.
|
static <T> Entity<T> |
xml(T entity)
Create an "application/xml" entity.
|
public static <T> Entity<T> entity(T entity, MediaType mediaType)
T
- entity Java type.entity
- entity data.mediaType
- entity content type.public static <T> Entity<T> entity(T entity, MediaType mediaType, Annotation[] annotations)
T
- entity Java type.entity
- entity data.mediaType
- entity content type.annotations
- entity annotations.public static <T> Entity<T> entity(T entity, String mediaType)
T
- entity Java type.entity
- entity data.mediaType
- entity content type.IllegalArgumentException
- if the supplied string cannot be parsed
or is null
.public static <T> Entity<T> entity(T entity, Variant variant)
T
- entity Java type.entity
- entity data.variant
- entity variant
information.public static <T> Entity<T> entity(T entity, Variant variant, Annotation[] annotations)
T
- entity Java type.entity
- entity data.variant
- entity variant
information.annotations
- entity annotations.public static <T> Entity<T> text(T entity)
T
- entity Java type.entity
- entity data.public static <T> Entity<T> xml(T entity)
T
- entity Java type.entity
- entity data.public static <T> Entity<T> json(T entity)
T
- entity Java type.entity
- entity data.public static <T> Entity<T> html(T entity)
T
- entity Java type.entity
- entity data.public static <T> Entity<T> xhtml(T entity)
T
- entity Java type.entity
- entity data.public static Entity<Form> form(Form form)
form
- form data.public static Entity<Form> form(MultivaluedMap<String,String> formData)
formData
- multivalued map representing the form data.public Variant getVariant()
variant
information.public MediaType getMediaType()
public String getEncoding()
public Locale getLanguage()
public T getEntity()
public Annotation[] getAnnotations()
Copyright © 2016 JBoss by Red Hat. All rights reserved.