MCPcopy Create free account
hub / github.com/grpc/grpc-java / fromStatus

Method fromStatus

api/src/main/java/io/grpc/StatusOr.java:42–46  ·  view source on GitHub ↗

Construct from a non-Ok status.

(Status status)

Source from the content-addressed store, hash-verified

40
41 /** Construct from a non-Ok status. */
42 public static <T> StatusOr<T> fromStatus(Status status) {
43 StatusOr<T> result = new StatusOr<T>(checkNotNull(status, "status"), null);
44 checkArgument(!status.isOk(), "cannot use OK status: %s", status);
45 return result;
46 }
47
48 /** Returns whether there is a value. */
49 public boolean hasValue() {

Calls 2

checkNotNullMethod · 0.80
isOkMethod · 0.45