Construct from a non-Ok status.
(Status status)
| 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() { |