milvus-logo
Star
0
Forks
0
Get Started

Class R

  • java.lang.Object
    • io.milvus.param.R<T>

  • public class R
    extends java.lang.Object
    Utility class to wrap gpc response and exceptions.
    • Nested Class Summary

      Modifier and Type Class Description
      static class  R.Status
      Represents server and client side status code
    • Constructor Summary

      Constructor Description
      R()  
    • Method Summary

      Modifier and Type Method Description
      static <T> R<T> failed​(io.milvus.grpc.ErrorCode errorCode, java.lang.String msg)
      Wraps an error code and error message for failure.
      static <T> R<T> failed​(R.Status statusCode, java.lang.String msg)
      Wraps a status code and error message for failure.
      static <T> R<T> failed​(java.lang.Exception exception)
      Wraps an exception for failure.
      T getData()  
      java.lang.Exception getException()  
      java.lang.String getMessage()  
      java.lang.Integer getStatus()  
      void setData​(T data)  
      void setException​(java.lang.Exception exception)  
      void setStatus​(java.lang.Integer status)  
      static <T> R<T> success()
      Returns a succeed status.
      static <T> R<T> success​(T data)
      Wraps a succeed rpc response object.
      java.lang.String toString()
      Constructs a String by R instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • R

        public R()
    • Method Detail

      • getException

        public java.lang.Exception getException()
      • setException

        public void setException​(java.lang.Exception exception)
      • getMessage

        public java.lang.String getMessage()
      • getStatus

        public java.lang.Integer getStatus()
      • setStatus

        public void setStatus​(java.lang.Integer status)
      • getData

        public T getData()
      • setData

        public void setData​(T data)
      • failed

        public static <T> R<T> failed​(java.lang.Exception exception)
        Wraps an exception for failure.
        Parameters:
        exception - exception object
        Returns:
        R
      • failed

        public static <T> R<T> failed​(io.milvus.grpc.ErrorCode errorCode,
                                      java.lang.String msg)
        Wraps an error code and error message for failure.
        Parameters:
        errorCode - rpc error code
        msg - error message
        Returns:
        R
      • failed

        public static <T> R<T> failed​(R.Status statusCode,
                                      java.lang.String msg)
        Wraps a status code and error message for failure.
        Parameters:
        statusCode - status code
        msg - error message
        Returns:
        R
      • success

        public static <T> R<T> success()
        Returns a succeed status.
        Returns:
        R
      • success

        public static <T> R<T> success​(T data)
        Wraps a succeed rpc response object.
        Parameters:
        data - rpc response object
        Returns:
        R
      • toString

        public java.lang.String toString()
        Constructs a String by R instance.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String