Class UserResponseMessage

java.lang.Object
com.iohao.net.framework.protocol.CommonMessage
com.iohao.net.framework.protocol.UserResponseMessage
All Implemented Interfaces:
CommonResponse, FutureMessage, RemoteMessage, Response, UserIdentity

public final class UserResponseMessage extends CommonMessage implements Response
User-facing response message sent back through the external Netty pipeline to the client.

Extends BarMessage and implements Response to provide typed data extraction from the serialized payload. Decoding uses the external-facing codec obtained from DataCodecManager. The factory method of() creates a new instance pre-configured with the business command code.

Author:
渔民小镇
date:
2021-12-20
  • Constructor Details

    • UserResponseMessage

      public UserResponseMessage()
  • Method Details

    • getValue

      public <T> T getValue(Class<T> clazz)
      Decode the response payload into the specified type.
      Specified by:
      getValue in interface Response
      Type Parameters:
      T - the target type
      Parameters:
      clazz - the class to decode into
      Returns:
      the decoded object
    • listValue

      public <T> List<T> listValue(Class<? extends T> clazz)
      Decode the response payload into a list of the specified element type.
      Specified by:
      listValue in interface Response
      Type Parameters:
      T - the element type
      Parameters:
      clazz - the element class to decode into
      Returns:
      a list of decoded objects
    • of

      public static UserResponseMessage of()
      Create a new UserResponseMessage pre-configured with the business command code.
      Returns:
      a new user response message