Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions api/src/main/java/io/grpc/StatusOr.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private StatusOr(Status status, T value) {
}

/** Construct from a value. */
public static <T> StatusOr<T> fromValue(@Nullable T value) {
public static <T> StatusOr<T> fromValue(T value) {
StatusOr<T> result = new StatusOr<T>(null, value);
return result;
}
Expand All @@ -54,7 +54,7 @@ public boolean hasValue() {
* Returns the value if set or throws exception if there is no value set. This method is meant
* to be called after checking the return value of hasValue() first.
*/
public @Nullable T getValue() {
public T getValue() {
if (status != null) {
throw new IllegalStateException("No value present.");
}
Expand Down Expand Up @@ -105,6 +105,7 @@ public String toString() {
return stringHelper.toString();
}

@Nullable
private final Status status;
private final T value;
}