Package org.scictrl.csshell
Class ResponseImpl<C extends AbstractConnector<?>>
java.lang.Object
org.scictrl.csshell.ResponseImpl<C>
- Type Parameters:
C
- connector implementation
- All Implemented Interfaces:
Response<C>
Default response implementation
- Author:
- igor@scictrl.com
-
Constructor Summary
ConstructorDescriptionResponseImpl
(Connection<C, ?, ?> source, Request<C> r, Object tag, boolean success, Exception error, Poop<?, ?> poop, boolean last) Creates a new ResponseImpl object. -
Method Summary
Modifier and TypeMethodDescriptionConnection
<C, ?, ?> Returns the source of the response, same as in associated Request.getError()
If result of the request is an error this method will return it.Poop
<?, ?> getPoop()
Returns the condition of the responseReturnsRequest
object, which initiated this response.getTag()
Optional identification tag of the response.boolean
isLast()
Returnstrue
if this is last response in series of responses.boolean
Returnstrue
if the request was successfully completed.toString()
-
Constructor Details
-
Method Details
-
getError
If result of the request is an error this method will return it. Otherwise it will returnnull
- Specified by:
getError
in interfaceResponse<C extends AbstractConnector<?>>
- Returns:
- error
-
getRequest
ReturnsRequest
object, which initiated this response.- Specified by:
getRequest
in interfaceResponse<C extends AbstractConnector<?>>
- Returns:
- initial
Request
-
getTag
Optional identification tag of the response. Interpretation depends on asynchronus methods which generated this response.- Specified by:
getTag
in interfaceResponse<C extends AbstractConnector<?>>
- Returns:
- identification tag.
-
isLast
public boolean isLast()Returnstrue
if this is last response in series of responses.- Specified by:
isLast
in interfaceResponse<C extends AbstractConnector<?>>
- Returns:
true
if it is last response
-
getConnection
Returns the source of the response, same as in associated Request.- Specified by:
getConnection
in interfaceResponse<C extends AbstractConnector<?>>
- Returns:
- response source
-
getPoop
Returns the condition of the response- Specified by:
getPoop
in interfaceResponse<C extends AbstractConnector<?>>
- Returns:
- response condition
-
isSuccess
public boolean isSuccess()Returnstrue
if the request was successfully completed.- Specified by:
isSuccess
in interfaceResponse<C extends AbstractConnector<?>>
- Returns:
- returns true if response is a success
-
toString
-