Class ErrorOr<T>
java.lang.Object
io.smallrye.graphql.client.typesafe.api.ErrorOr<T>
- Direct Known Subclasses:
TypesafeResponse
Like an
Optional, but the value can be null and instead of a value,
there can be a List of GraphQLErrors instead.
There can be the paradox situation that there is a value as well as errors,
but this is what a GraphQL service could theoretically return!-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean<U> ErrorOr<U> get()voidbooleaninthashCode()voidboolean<U> ErrorOr<U> static <T> ErrorOr<T> of(T value) static <T> ErrorOr<T> ofErrors(List<GraphQLError> errors) optional()Note that anOptionalcan not containnull, so this method will return an empty Optional in this case.stream()toString()
-
Constructor Details
-
ErrorOr
-
-
Method Details
-
of
-
ofErrors
-
equals
-
hashCode
public int hashCode() -
toString
-
isPresent
public boolean isPresent() -
hasErrors
public boolean hasErrors() -
get
-
getErrors
-
ifPresent
-
handle
-
map
-
flatMap
-
optional
Note that anOptionalcan not containnull, so this method will return an empty Optional in this case. -
stream
-