T
- entity type.public final class Entity<T>
extends java.lang.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,
java.lang.annotation.Annotation[] annotations)
Create an entity using a supplied content media type.
|
static <T> Entity<T> |
entity(T entity,
java.lang.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,
java.lang.annotation.Annotation[] annotations)
Create an entity using a supplied content media type.
|
boolean |
equals(java.lang.Object o) |
static Entity<Form> |
form(Form form)
Create an "application/x-www-form-urlencoded"
form entity.
|
static Entity<Form> |
form(MultivaluedMap<java.lang.String,java.lang.String> formData)
Create an "application/x-www-form-urlencoded"
form entity.
|
java.lang.annotation.Annotation[] |
getAnnotations()
Get the entity annotations.
|
java.lang.String |
getEncoding()
Get entity encoding.
|
T |
getEntity()
Get entity data.
|
java.util.Locale |
getLanguage()
Get entity language.
|
MediaType |
getMediaType()
Get entity media type.
|
Variant |
getVariant()
Get entity
variant information. |
int |
hashCode() |
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.
|
java.lang.String |
toString() |
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, java.lang.annotation.Annotation[] annotations)
T
- entity Java type.entity
- entity data.mediaType
- entity content type.annotations
- entity annotations.public static <T> Entity<T> entity(T entity, java.lang.String mediaType)
T
- entity Java type.entity
- entity data.mediaType
- entity content type.java.lang.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, java.lang.annotation.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<java.lang.String,java.lang.String> formData)
formData
- multivalued map representing the form data.public Variant getVariant()
variant
information.public MediaType getMediaType()
public java.lang.String getEncoding()
public java.util.Locale getLanguage()
public T getEntity()
public java.lang.annotation.Annotation[] getAnnotations()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object