public class GraphqlUtils extends Object
| Constructor and Description |
|---|
GraphqlUtils() |
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
checkFieldOfGraphQLType(String name,
Boolean shouldBeScalar,
Class<?> owningClass)
Check if the given field is owned by the class of this
ObjectResponse. |
void |
checkName(String graphqlIdentifier)
Checks that the given GraphQL name is valid.
|
Class<?> |
getGraphQLType(AccessibleObject fieldOrMethod)
Returns the Class indicated as the value for the graphqlType attribute of the GraphQLScalar or GraphQLNonScalar
annotation
|
boolean |
isScalar(AccessibleObject fieldOrMethod)
Indicates whether the given class is a scalar or not
|
public void checkName(String graphqlIdentifier) throws GraphQLRequestPreparationException
graphqlIdentifier - NullPointerException - If name is nullGraphQLRequestPreparationException - If the given graphqlIdentifier is not a valid identifierpublic Class<?> checkFieldOfGraphQLType(String name, Boolean shouldBeScalar, Class<?> owningClass) throws GraphQLRequestPreparationException
ObjectResponse. This method returns the class for
this field.name - The name of the field we want to checkshouldBeScalar - if true: also checks that the field is a scalar (throws a GraphQLRequestPreparationException if not).
If false: also checks that the field is not a scalar (throws a GraphQLRequestPreparationException if
not). If null: no check whether the field is a scalar or notowningClass - The class in which will search for name as a GraphQL fieldNullPointerException - if name is nullGraphQLRequestPreparationException - if the check is KOpublic boolean isScalar(AccessibleObject fieldOrMethod) throws GraphQLRequestPreparationException
fieldOrMethod - GraphQLRequestPreparationExceptionpublic Class<?> getGraphQLType(AccessibleObject fieldOrMethod) throws GraphQLRequestPreparationException
fieldOrMethod - GraphQLRequestPreparationExceptionCopyright © 2019. All rights reserved.