Interface Response
- All Superinterfaces:
CommonResponse, FutureMessage, RemoteMessage, UserIdentity
- All Known Implementing Classes:
ResponseMessage, UserResponseMessage
Represent an outbound response message with typed data extraction capabilities.
Extends RemoteMessage for inter-server fields, CommonResponse for error
information, and UserIdentity for user binding. Provides convenience methods
to decode the raw response payload into single values or lists of common types
(String, int, long, boolean) as well as arbitrary protobuf-compatible types.
- Since:
- 25.1
- Author:
- 渔民小镇
- date:
- 2025-09-07
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanGet the response payload as a single boolean value.default <T> TDecode the response payload into the specified type.default intgetInt()Get the response payload as a single int value.default longgetLong()Get the response payload as a single long value.default StringGet the response payload as a single String value.<T> TDecode the response payload into the specified type.Get the response payload as a list of Boolean values.listInt()Get the response payload as a list of Integer values.listLong()Get the response payload as a list of Long values.Get the response payload as a list of String values.<T> List<T> Decode the response payload into a list of the specified element type.Methods inherited from interface CommonResponse
getErrorCode, getErrorMessage, hasError, isSuccess, setError, setErrorCode, setErrorMessageMethods inherited from interface FutureMessage
getFutureId, setFutureIdMethods inherited from interface RemoteMessage
getCmdInfo, getCmdMerge, getData, getExternalServerId, getLogicServerId, getNanoTime, getNetId, getSourceServerId, getTraceId, setCmdInfo, setCmdMerge, setData, setExternalServerId, setLogicServerId, setNanoTime, setNetId, setOutputError, setSourceServerId, setTraceIdMethods inherited from interface UserIdentity
bindingUserId, getUserId, isVerifyIdentity, setUserId, setUserIdentity, setVerifyIdentity, verifyIdentity
-
Method Details
-
getData
Decode the response payload into the specified type.Alias for
getValue(Class).- Type Parameters:
T- the target type- Parameters:
clazz- the class to decode into- Returns:
- the decoded object
-
getValue
Decode the response payload into the specified type.- Type Parameters:
T- the target type- Parameters:
clazz- the class to decode into- Returns:
- the decoded object
-
listValue
-
getString
Get the response payload as a single String value.- Returns:
- the decoded string
-
listString
-
getInt
default int getInt()Get the response payload as a single int value.- Returns:
- the decoded int
-
listInt
-
getLong
default long getLong()Get the response payload as a single long value.- Returns:
- the decoded long
-
listLong
-
getBoolean
default boolean getBoolean()Get the response payload as a single boolean value.- Returns:
- the decoded boolean
-
listBoolean
-