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
ConstructorsConstructorDescriptionResponseImpl(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 responseReturnsRequestobject, which initiated this response.getTag()Optional identification tag of the response.booleanisLast()Returnstrueif this is last response in series of responses.booleanReturnstrueif 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:
getErrorin interfaceResponse<C extends AbstractConnector<?>>- Returns:
- error
-
getRequest
ReturnsRequestobject, which initiated this response.- Specified by:
getRequestin 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:
getTagin interfaceResponse<C extends AbstractConnector<?>>- Returns:
- identification tag.
-
isLast
public boolean isLast()Returnstrueif this is last response in series of responses.- Specified by:
isLastin interfaceResponse<C extends AbstractConnector<?>>- Returns:
trueif it is last response
-
getConnection
Returns the source of the response, same as in associated Request.- Specified by:
getConnectionin interfaceResponse<C extends AbstractConnector<?>>- Returns:
- response source
-
getPoop
Returns the condition of the response- Specified by:
getPoopin interfaceResponse<C extends AbstractConnector<?>>- Returns:
- response condition
-
isSuccess
public boolean isSuccess()Returnstrueif the request was successfully completed.- Specified by:
isSuccessin interfaceResponse<C extends AbstractConnector<?>>- Returns:
- returns true if response is a success
-
toString
-