Class InputCommand

java.lang.Object
com.iohao.net.extension.client.command.InputCommand

public class InputCommand extends Object
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 Details

    • InputCommand

      public InputCommand(CmdInfo cmdInfo)
  • Method Details

    • setRequestData

      public InputCommand setRequestData(RequestDataDelegate requestData)
    • callback

      public InputCommand callback(CallbackDelegate callback)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getInputName

      public String getInputName()
    • getTitle

      public String getTitle()
      Display description for the simulated request command.
    • getCmdName

      public String getCmdName()
      Prefix label displayed before the command title.
    • getRequestData

      public RequestDataDelegate getRequestData()
      Request payload supplier.
    • getCallback

      public CallbackDelegate getCallback()
      Response callback.
    • setTitle

      public InputCommand setTitle(String title)
      Display description for the simulated request command.
      Returns:
      this.
    • setCmdName

      public InputCommand setCmdName(String cmdName)
      Prefix label displayed before the command title.
      Returns:
      this.
    • getCmdInfo

      public CmdInfo getCmdInfo()