public class RestCaller extends Object
Constructor and Description |
---|
RestCaller() |
Modifier and Type | Method and Description |
---|---|
<T> T |
convert(Class<T> clazz)
Convert (map) response in string value to an object
|
static RestCaller |
create()
Create new instance
|
<T> T |
delete(Class<T> clazz)
Call restful user DELETE method and map value to an object
|
HttpEntityBuilder |
entity()
Create HttpEntityBuilder object
|
<T> T |
get(Class<T> clazz)
Call restful user GET method and map value to an object
|
<T> T |
post(Class<T> clazz)
Call restful user POST method and map value to an object
|
<T> T |
put(Class<T> clazz)
Call restful user PUT method and map value to an object
|
RestCaller |
string()
Call restful user GET method and map value to string
|
RestTemplateBuilder |
template()
Create a RestTemplateBuilder object
|
HttpUriBuilder |
uri()
Create a HttpUriBuilder object
|
protected void |
validateAll()
Validate all builder objects
|
protected void |
validateTemplate()
Validate the rest template builder object
|
protected void |
validateUriBuilder()
Validate the uri builder
|
public static RestCaller create()
public HttpUriBuilder uri()
public HttpEntityBuilder entity()
public RestTemplateBuilder template()
protected void validateUriBuilder()
IllegalStateException
- when the uri builder is nullprotected void validateTemplate()
IllegalStateException
- when the builder object is nullprotected void validateAll()
public <T> T get(Class<T> clazz)
clazz
- class of the object to mappublic <T> T post(Class<T> clazz)
clazz
- class of the object to mappublic <T> T put(Class<T> clazz)
clazz
- class of the object to mappublic <T> T delete(Class<T> clazz)
clazz
- class of the object to mappublic RestCaller string()
public <T> T convert(Class<T> clazz)
clazz
- class of object to convertCopyright © 2012–2016 Young Monkeys. All rights reserved.