Class StatusUtils

java.lang.Object
io.temporal.serviceclient.StatusUtils

public class StatusUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends com.google.protobuf.Message>
    T
    getFailure(io.grpc.StatusRuntimeException exception, Class<T> failureType)
     
    static boolean
    hasFailure(io.grpc.StatusRuntimeException exception, Class<? extends com.google.protobuf.Message> failureType)
    Determines if a StatusRuntimeException contains a failure message of a given type.
    static <T extends com.google.protobuf.Message>
    io.grpc.StatusRuntimeException
    newException(io.grpc.Status status, T details, com.google.protobuf.Descriptors.Descriptor detailsDescriptor)
    Create StatusRuntimeException with given details.

    Methods inherited from class java.lang.Object

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

    • StatusUtils

      public StatusUtils()
  • Method Details

    • hasFailure

      public static boolean hasFailure(io.grpc.StatusRuntimeException exception, Class<? extends com.google.protobuf.Message> 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.Message> T getFailure(io.grpc.StatusRuntimeException exception, Class<T> failureType)
      Returns:
      a failure of a given type from the StatusRuntimeException object
    • newException

      public static <T extends com.google.protobuf.Message> io.grpc.StatusRuntimeException newException(io.grpc.Status status, T details, com.google.protobuf.Descriptors.Descriptor detailsDescriptor)
      Create StatusRuntimeException with given details.