org.codegist.crest.io
Interface Response
- All Superinterfaces:
- Disposable
public interface Response
- extends Disposable
CRest's internal REST interface method's call execution response
getRequest
Request getRequest()
- Returns:
- original request
getStatusCode
int getStatusCode()
throws Exception
- Throws:
Exception
getContentType
String getContentType()
throws Exception
- Throws:
Exception
getCharset
Charset getCharset()
throws Exception
- Throws:
Exception
getContentEncoding
String getContentEncoding()
throws Exception
- Throws:
Exception
getExpectedGenericType
Type getExpectedGenericType()
- Returns:
- expected method generic return type
getExpectedType
Class<?> getExpectedType()
- Returns:
- expected method return type
deserialize
<T> T deserialize()
throws Exception
- Type Parameters:
T - Method's return type
- Returns:
- the deserialized response to the expected method return type
- Throws:
Exception - Any exception thrown during deserialization process
to
<T> T to(Class<T> type)
throws Exception
- Type Parameters:
T - type to deserialize the response to- Parameters:
type - type to deserialize the response to
- Returns:
- deserialized response
- Throws:
Exception - Any exception thrown during deserialization process
to
<T> T to(Class<T> type,
Type genericType)
throws Exception
- Type Parameters:
T - type to deserialize the response to- Parameters:
type - type to deserialize the response togenericType - generic type to deserialize the response to
- Returns:
- deserialized response
- Throws:
Exception - Any exception thrown during deserialization process
asStream
InputStream asStream()
throws Exception
- Returns:
- underlying response entity stream
- Throws:
Exception - Any exception thrown during transaction
Copyright © 2011. All Rights Reserved.