类 CommandResponse<R>

java.lang.Object
com.alibaba.csp.sentinel.command.CommandResponse<R>
类型参数:
R - type of the result

public class CommandResponse<R> extends Object
Command response representation of command center.
作者:
Eric Zhao
  • 方法详细资料

    • ofSuccess

      public static <T> CommandResponse<T> ofSuccess(T result)
      Construct a successful response with given object.
      类型参数:
      T - type of the result
      参数:
      result - result object
      返回:
      constructed server response
    • ofFailure

      public static <T> CommandResponse<T> ofFailure(Throwable ex)
      Construct a failed response with given exception.
      参数:
      ex - cause of the failure
      返回:
      constructed server response
    • ofFailure

      public static <T> CommandResponse<T> ofFailure(Throwable ex, T result)
      Construct a failed response with given exception.
      参数:
      ex - cause of the failure
      result - additional message of the failure
      返回:
      constructed server response
    • isSuccess

      public boolean isSuccess()
    • getResult

      public R getResult()
    • getException

      public Throwable getException()