Package jakarta.ws.rs.client
Class Entity<T>
java.lang.Object
jakarta.ws.rs.client.Entity<T>
- Type Parameters:
- T- entity type.
public final class Entity<T> extends Object
Encapsulates message entity including the associated variant information.
- Author:
- Marek Potociar
- 
Method SummaryModifier and Type Method 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, 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 <T> Entity<T>entity(T entity, String mediaType)Create an entity using a supplied content media type.booleanequals(Object o)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.StringgetEncoding()Get entity encoding.TgetEntity()Get entity data.LocalegetLanguage()Get entity language.MediaTypegetMediaType()Get entity media type.VariantgetVariant()Get entityvariantinformation.inthashCode()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.StringtoString()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.
- 
Method Details- 
entityCreate an entity using a supplied content media type.- Type Parameters:
- T- entity Java type.
- Parameters:
- entity- entity data.
- mediaType- entity content type.
- Returns:
- entity instance.
 
- 
entityCreate an entity using a supplied content media type.- Type Parameters:
- T- entity Java type.
- Parameters:
- entity- entity data.
- mediaType- entity content type.
- annotations- entity annotations.
- Returns:
- entity instance.
 
- 
entityCreate an entity using a supplied content media type.- Type Parameters:
- T- entity Java type.
- Parameters:
- entity- entity data.
- mediaType- entity content type.
- Returns:
- entity instance.
- Throws:
- IllegalArgumentException- if the supplied string cannot be parsed or is- null.
 
- 
entityCreate an entity using a supplied content media type.- Type Parameters:
- T- entity Java type.
- Parameters:
- entity- entity data.
- variant- entity- variantinformation.
- Returns:
- entity instance.
 
- 
entityCreate an entity using a supplied content media type.- Type Parameters:
- T- entity Java type.
- Parameters:
- entity- entity data.
- variant- entity- variantinformation.
- annotations- entity annotations.
- Returns:
- entity instance.
 
- 
textCreate a "text/plain" entity.- Type Parameters:
- T- entity Java type.
- Parameters:
- entity- entity data.
- Returns:
- "text/plain" entity instance.
 
- 
xmlCreate an "application/xml" entity.- Type Parameters:
- T- entity Java type.
- Parameters:
- entity- entity data.
- Returns:
- "application/xml" entity instance.
 
- 
jsonCreate an "application/json" entity.- Type Parameters:
- T- entity Java type.
- Parameters:
- entity- entity data.
- Returns:
- "application/json" entity instance.
 
- 
htmlCreate a "text/html" entity.- Type Parameters:
- T- entity Java type.
- Parameters:
- entity- entity data.
- Returns:
- "text/html" entity instance.
 
- 
xhtmlCreate an "application/xhtml+xml" entity.- Type Parameters:
- T- entity Java type.
- Parameters:
- entity- entity data.
- Returns:
- "application/xhtml+xml" entity instance.
 
- 
formCreate an "application/x-www-form-urlencoded" form entity.- Parameters:
- form- form data.
- Returns:
- "application/x-www-form-urlencoded" form entity instance.
 
- 
formCreate an "application/x-www-form-urlencoded" form entity.- Parameters:
- formData- multivalued map representing the form data.
- Returns:
- "application/x-www-form-urlencoded" form entity instance.
 
- 
getVariantGet entityvariantinformation.- Returns:
- entity variant information.
 
- 
getMediaTypeGet entity media type.- Returns:
- entity media type.
 
- 
getEncodingGet entity encoding.- Returns:
- entity encoding.
 
- 
getLanguageGet entity language.- Returns:
- entity language.
 
- 
getEntityGet entity data.- Returns:
- entity data.
 
- 
getAnnotationsGet the entity annotations.- Returns:
- entity annotations if set, an empty annotation array if no entity annotations have been specified.
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-