Class WebResult<T>


  • public class WebResult<T>
    extends java.lang.Object
    web result
    Since:
    0.1
    Author:
    PARK Yong Seo
    • Method Summary

      Modifier and Type Method Description
      T getBody()
      get response body data
      T getBody​(T orElse)
      get response body data
      T getBodyWithThrow()
      get response body data throw null body
      <X extends java.lang.Throwable>
      T
      getBodyWithThrow​(java.util.function.Supplier<? extends X> exceptionSupplier)
      get response body data throw null body
      java.lang.String getErrorBody()
      get response error body data
      java.lang.String getErrorBody​(java.lang.String orElse)
      get response error body data
      boolean hasBody()
      has body
      boolean isStatus2xx()
      is status 2xx
      boolean isStatus3xx()
      is status 3xx
      boolean isStatus4xx()
      is status 4xx
      boolean isStatus5xx()
      is status 5xx
      boolean isSuccess()
      is status 2xx + have not exception
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isSuccess

        public boolean isSuccess()
        is status 2xx + have not exception
        Returns:
      • isStatus2xx

        public boolean isStatus2xx()
        is status 2xx
        Returns:
      • isStatus3xx

        public boolean isStatus3xx()
        is status 3xx
        Returns:
      • isStatus4xx

        public boolean isStatus4xx()
        is status 4xx
        Returns:
      • isStatus5xx

        public boolean isStatus5xx()
        is status 5xx
        Returns:
      • hasBody

        public boolean hasBody()
        has body
        Returns:
      • getBody

        public T getBody()
        get response body data
        Returns:
        Optional response body data
      • getBody

        public T getBody​(T orElse)
        get response body data
        Parameters:
        orElse -
        Returns:
      • getBodyWithThrow

        public <X extends java.lang.Throwable> T getBodyWithThrow​(java.util.function.Supplier<? extends X> exceptionSupplier)
                                                           throws X extends java.lang.Throwable
        get response body data throw null body
        Returns:
        Optional response body data
        Throws:
        X
        X extends java.lang.Throwable
      • getBodyWithThrow

        public T getBodyWithThrow()
                           throws java.lang.NullPointerException
        get response body data throw null body
        Returns:
        Optional response body data
        Throws:
        java.lang.NullPointerException
      • getErrorBody

        public java.lang.String getErrorBody()
        get response error body data
        Returns:
        Optional response body data
      • getErrorBody

        public java.lang.String getErrorBody​(java.lang.String orElse)
        get response error body data
        Parameters:
        orElse -
        Returns: