Class GraphQLContextExtensionsKt
-
- All Implemented Interfaces:
public final class GraphQLContextExtensionsKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> T
get(GraphQLContext $self)
Returns a value in the context by KClass key final static <T extends Any> T
getOrDefault(GraphQLContext $self, T defaultValue)
Returns a value in the context by KClass key final static <T extends Any> T
getOrElse(GraphQLContext $self, Function0<T> defaultValue)
Returns a value in the context by KClass key final static <T extends Any> T
getOrThrow(GraphQLContext $self)
Returns a value in the context by KClass key or KeyNotFoundInGraphQLContextException if key was not found final static GraphQLContext
plus(GraphQLContext $self, GraphQLContext graphQLContext)
Puts all the values of graphQLContext into this GraphQLContext final static GraphQLContext
plus(GraphQLContext $self, Map<?, Object> map)
Puts all the values of map into this GraphQLContext final static GraphQLContext
toGraphQLContext(Map<?, Object> $self)
Create a GraphQLContext from this map -
-
Method Detail
-
get
final static <T extends Any> T get(GraphQLContext $self)
Returns a value in the context by KClass key
-
getOrDefault
final static <T extends Any> T getOrDefault(GraphQLContext $self, T defaultValue)
Returns a value in the context by KClass key
- Parameters:
defaultValue
- the default value to use if there is no KClass key entry
-
getOrElse
final static <T extends Any> T getOrElse(GraphQLContext $self, Function0<T> defaultValue)
Returns a value in the context by KClass key
- Parameters:
defaultValue
- function to invoke if there is no KClass key entry
-
getOrThrow
final static <T extends Any> T getOrThrow(GraphQLContext $self)
Returns a value in the context by KClass key or KeyNotFoundInGraphQLContextException if key was not found
-
plus
final static GraphQLContext plus(GraphQLContext $self, GraphQLContext graphQLContext)
Puts all the values of graphQLContext into this GraphQLContext
- Parameters:
graphQLContext
- which values will be added into this GraphQLContext
-
plus
final static GraphQLContext plus(GraphQLContext $self, Map<?, Object> map)
Puts all the values of map into this GraphQLContext
- Parameters:
map
- which values will be added into this GraphQLContext
-
toGraphQLContext
final static GraphQLContext toGraphQLContext(Map<?, Object> $self)
Create a GraphQLContext from this map
-
-
-
-