Package jakarta.ws.rs.client
Class Entity<T>
java.lang.Object
jakarta.ws.rs.client.Entity<T>
- Type Parameters:
T
- entity type.
Encapsulates message entity including the associated variant information.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Entity<T>
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>
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>
Create an entity using a supplied content media type.boolean
Create an "application/x-www-form-urlencoded" form entity.form
(MultivaluedMap<String, String> formData) Create an "application/x-www-form-urlencoded" form entity.Get the entity annotations.Get entity encoding.Get entity data.Get entity language.Get entity media type.Get entityvariant
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.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.
-
Method Details
-
entity
Create 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.
-
entity
Create 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.
-
entity
Create 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 isnull
.
-
entity
Create an entity using a supplied content media type.- Type Parameters:
T
- entity Java type.- Parameters:
entity
- entity data.variant
- entityvariant
information.- Returns:
- entity instance.
-
entity
Create an entity using a supplied content media type.- Type Parameters:
T
- entity Java type.- Parameters:
entity
- entity data.variant
- entityvariant
information.annotations
- entity annotations.- Returns:
- entity instance.
-
text
Create a "text/plain" entity.- Type Parameters:
T
- entity Java type.- Parameters:
entity
- entity data.- Returns:
- "text/plain" entity instance.
-
xml
Create an "application/xml" entity.- Type Parameters:
T
- entity Java type.- Parameters:
entity
- entity data.- Returns:
- "application/xml" entity instance.
-
json
Create an "application/json" entity.- Type Parameters:
T
- entity Java type.- Parameters:
entity
- entity data.- Returns:
- "application/json" entity instance.
-
html
Create a "text/html" entity.- Type Parameters:
T
- entity Java type.- Parameters:
entity
- entity data.- Returns:
- "text/html" entity instance.
-
xhtml
Create an "application/xhtml+xml" entity.- Type Parameters:
T
- entity Java type.- Parameters:
entity
- entity data.- Returns:
- "application/xhtml+xml" entity instance.
-
form
Create an "application/x-www-form-urlencoded" form entity.- Parameters:
form
- form data.- Returns:
- "application/x-www-form-urlencoded" form entity instance.
-
form
Create 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.
-
getVariant
Get entityvariant
information.- Returns:
- entity variant information.
-
getMediaType
Get entity media type.- Returns:
- entity media type.
-
getEncoding
Get entity encoding.- Returns:
- entity encoding.
-
getLanguage
Get entity language.- Returns:
- entity language.
-
getEntity
Get entity data.- Returns:
- entity data.
-
getAnnotations
Get the entity annotations.- Returns:
- entity annotations if set, an empty annotation array if no entity annotations have been specified.
-
equals
-
hashCode
public int hashCode() -
toString
-