public final class GrpcStatus
extends Object
GrpcStatusCode| Constructor and Description |
|---|
GrpcStatus(GrpcStatusCode code)
Constructs a status with no cause or description.
|
GrpcStatus(GrpcStatusCode code,
String description)
Constructs a status with cause and additional description.
|
GrpcStatus(GrpcStatusCode code,
Throwable cause)
Deprecated.
Use
GrpcStatusException if there is a Throwable cause. |
GrpcStatus(GrpcStatusCode code,
Throwable cause,
CharSequence description)
Deprecated.
Use
GrpcStatusException if there is a cause or
GrpcStatus(GrpcStatusCode, String). |
| Modifier and Type | Method and Description |
|---|---|
GrpcStatusException |
asException()
Deprecated.
|
GrpcStatusException |
asException(Supplier<Status> applicationStatusSupplier)
Deprecated.
|
Throwable |
cause()
Deprecated.
Use
GrpcStatusException.fromThrowable(Throwable) to create a GrpcStatusException
then Throwable.getCause(). |
GrpcStatusCode |
code()
Returns the status code.
|
String |
description()
Returns additional descriptions, can be null.
|
boolean |
equals(Object o) |
static GrpcStatus |
fromCodeValue(int codeValue)
Obtains the status given an integer code value.
|
static GrpcStatus |
fromCodeValue(String codeValue)
Obtains the status given a code value string.
|
static GrpcStatus |
fromThrowable(Throwable t)
Deprecated.
|
static GrpcStatus |
fromThrowableNullable(Throwable t)
Deprecated.
|
int |
hashCode() |
String |
toString() |
public GrpcStatus(GrpcStatusCode code)
code - status code.@Deprecated public GrpcStatus(GrpcStatusCode code, @Nullable Throwable cause)
GrpcStatusException if there is a Throwable cause.code - status code.cause - cause.@Deprecated public GrpcStatus(GrpcStatusCode code, @Nullable Throwable cause, @Nullable CharSequence description)
GrpcStatusException if there is a cause or
GrpcStatus(GrpcStatusCode, String).code - status code.cause - cause.description - additional description.public GrpcStatus(GrpcStatusCode code, @Nullable String description)
code - status code.description - additional description.public static GrpcStatus fromCodeValue(String codeValue)
codeValue - code value string.GrpcStatusCode.UNKNOWN.public static GrpcStatus fromCodeValue(int codeValue)
codeValue - integer code value.GrpcStatusCode.UNKNOWN.@Deprecated public static GrpcStatus fromThrowable(Throwable t)
GrpcStatusException.fromThrowable(Throwable).t - the throwable.GrpcStatusException, or an GrpcStatusCode.UNKNOWN
status with the throwable as the cause.@Nullable @Deprecated public static GrpcStatus fromThrowableNullable(Throwable t)
GrpcStatusException.fromThrowable(Throwable).t - the throwable.GrpcStatusException, or null.@Deprecated public GrpcStatusException asException()
GrpcStatusException(GrpcStatus).GrpcStatusException.GrpcStatusException.@Deprecated public GrpcStatusException asException(Supplier<Status> applicationStatusSupplier)
GrpcStatusException.of(Status).GrpcStatusException including the supplied details.
The status code used by Status and the one of the GrpcStatus must be the same.
Users should usually use GrpcStatusException.of(Status).applicationStatusSupplier - the Supplier for the Status.GrpcStatusException.public GrpcStatusCode code()
@Nullable @Deprecated public Throwable cause()
GrpcStatusException.fromThrowable(Throwable) to create a GrpcStatusException
then Throwable.getCause().@Nullable public String description()
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object