Class Response<T>

java.lang.Object
com.xxl.tool.response.Response<T>
Type Parameters:
T -
All Implemented Interfaces:
Serializable

public class Response<T> extends Object implements Serializable
Response (from ReturnT of xxl-job)
Author:
xuxueli 2015-12-4 16:32:31
See Also:
  • Field Details

  • Constructor Details

    • Response

      public Response()
    • Response

      public Response(int code, String msg)
    • Response

      public Response(int code, String msg, T data)
  • Method Details

    • getCode

      public int getCode()
    • setCode

      public void setCode(int code)
    • getMsg

      public String getMsg()
    • setMsg

      public void setMsg(String msg)
    • getData

      public T getData()
    • setData

      public void setData(T data)
    • toString

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

      public boolean isSuccess()
      is success
      Returns:
      true if success, false otherwise
    • isSuccess

      public static boolean isSuccess(Response<?> response)
      is success
      Parameters:
      response - the response
      Returns:
      true if success, false otherwise
    • of

      public static <T> Response<T> of(int code, String msg, T data)
      build response
    • of

      public static <T> Response<T> of(int code, String msg)
      build response
    • ofSuccess

      public static <T> Response<T> ofSuccess(T data)
      build success response
    • ofSuccess

      public static <T> Response<T> ofSuccess()
      build success response
    • ofFail

      public static <T> Response<T> ofFail(String msg)
      build fail response
    • ofFail

      public static <T> Response<T> ofFail()
      build fail response