Class InputCommand
java.lang.Object
com.iohao.net.extension.client.command.InputCommand
Simulated client input command configuration.
example:
ofCommand(DemoCmd.here).setTitle("here").setRequestData(() -> {
YourMsg msg = ...
return msg;
}).callback(result -> {
HelloReq value = result.getValue(HelloReq.class);
log.info("value : {}", value);
});
ofCommand(DemoCmd.list).setTitle("list").callback(result -> {
// get list data
List<HelloReq> list = result.listValue(HelloReq.class);
log.info("list : {}", list);
});
- Author:
- 渔民小镇
- date:
- 2023-07-08
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncallback(CallbackDelegate callback) Response callback.Prefix label displayed before the command title.Request payload supplier.getTitle()Display description for the simulated request command.setCmdName(String cmdName) Prefix label displayed before the command title.setRequestData(RequestDataDelegate requestData) Display description for the simulated request command.toString()
-
Constructor Details
-
InputCommand
-
-
Method Details
-
setRequestData
-
callback
-
toString
-
getInputName
-
getTitle
Display description for the simulated request command. -
getCmdName
Prefix label displayed before the command title. -
getRequestData
Request payload supplier. -
getCallback
Response callback. -
setTitle
Display description for the simulated request command.- Returns:
this.
-
setCmdName
Prefix label displayed before the command title.- Returns:
this.
-
getCmdInfo
-