类 Result<T>

java.lang.Object
com.alibaba.nacos.api.model.v2.Result<T>
所有已实现的接口:
Serializable

public class Result<T> extends Object implements Serializable
Response Result.
作者:
dongyafei
另请参阅:
  • 构造器详细资料

    • Result

      public Result(Integer code, String message, T data)
    • Result

      public Result()
    • Result

      public Result(T data)
    • Result

      public Result(Integer code, String message)
  • 方法详细资料

    • success

      public static <T> Result<T> success()
      Success return with nothing.
      类型参数:
      T - data type
      返回:
      Result
    • success

      public static <T> Result<T> success(T data)
      Success return with data.
      类型参数:
      T - data type
      返回:
      Result
    • failure

      public static Result<String> failure(String message)
      Failed return with message and detail error information.
      返回:
      Result
    • failure

      public static <T> Result<T> failure(ErrorCode errorCode)
      Failed return with errorCode and message.
      类型参数:
      T - data type
      返回:
      Result
    • failure

      public static <T> Result<T> failure(ErrorCode errorCode, T data)
      Failed return with errorCode, message and data.
      类型参数:
      T - data type
      返回:
      Result
    • failure

      public static <T> Result<T> failure(Integer code, String msg, T data)
      Failed return with code, message and data.
      类型参数:
      T - data type
      参数:
      code - error code
      msg - error message
      返回:
      Result
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • getCode

      public Integer getCode()
    • getMessage

      public String getMessage()
    • getData

      public T getData()