Class StatusUtils


  • public class StatusUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      StatusUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends com.google.protobuf.GeneratedMessageV3>
      T
      getFailure​(io.grpc.StatusRuntimeException exception, java.lang.Class<T> failureType)  
      static boolean hasFailure​(io.grpc.StatusRuntimeException exception, java.lang.Class<? extends com.google.protobuf.GeneratedMessageV3> failureType)
      Determines if a StatusRuntimeException contains a failure message of a given type.
      static <T extends com.google.protobuf.GeneratedMessageV3>
      io.grpc.StatusRuntimeException
      newException​(io.grpc.Status status, T details)
      Create StatusRuntimeException with given details.
      • Methods inherited from class java.lang.Object

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

      • StatusUtils

        public StatusUtils()
    • Method Detail

      • hasFailure

        public static boolean hasFailure​(io.grpc.StatusRuntimeException exception,
                                         java.lang.Class<? extends com.google.protobuf.GeneratedMessageV3> failureType)
        Determines if a StatusRuntimeException contains a failure message of a given type.
        Returns:
        true if the given failure is found, false otherwise
      • getFailure

        public static <T extends com.google.protobuf.GeneratedMessageV3> T getFailure​(io.grpc.StatusRuntimeException exception,
                                                                                      java.lang.Class<T> failureType)
        Returns:
        a failure of a given type from the StatusRuntimeException object
      • newException

        public static <T extends com.google.protobuf.GeneratedMessageV3> io.grpc.StatusRuntimeException newException​(io.grpc.Status status,
                                                                                                                     T details)
        Create StatusRuntimeException with given details.