public class EchoCommandResponse extends AbstractCommandResponse
echo.| Constructor and Description |
|---|
EchoCommandResponse(CommandResponse responseToTransform)
Constructor for
EchoCommandResponse. |
EchoCommandResponse(Command cmd,
String echoMessage)
Constructor for
EchoCommandResponse that defines a successfully executed echo command. |
EchoCommandResponse(Command cmd,
Throwable exception)
Constructor for
EchoCommandResponse that defines a failed echo command. |
| Modifier and Type | Method and Description |
|---|---|
String |
getEchoMessage()
Provides a strong-typed method that clients can call to obtain the echo message.
|
getCommand, getException, getResults, isSuccessful, setCommand, setException, setResults, setSuccessful, toStringpublic EchoCommandResponse(Command cmd, String echoMessage)
EchoCommandResponse that defines a successfully executed echo command.cmd - the echo command that was executed (may be null)echoMessage - the message being echoed back to the clientpublic EchoCommandResponse(Command cmd, Throwable exception)
EchoCommandResponse that defines a failed echo command.cmd - the echo command that was executed (may be null)exception - the exception that caused the failure, if available (may be null)public EchoCommandResponse(CommandResponse responseToTransform)
EchoCommandResponse.public String getEchoMessage()
AbstractCommandResponse.getResults() and cast the return value to a String. This method
simply provides a way to help clients avoid that cast and to know exactly what type to expect.Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.