Class IdAdapter
- java.lang.Object
-
- io.leangen.graphql.generator.mapping.common.IdAdapter
-
- All Implemented Interfaces:
ArgumentInjector,InputConverter<Object,String>,OutputConverter<Object,String>,TypeMapper,TypeSubstituter
public class IdAdapter extends Object implements TypeMapper, ArgumentInjector, OutputConverter<Object,String>, InputConverter<Object,String>
Maps, converts and injects GraphQL IDs. Despite implementingInputConverterit can't actually be used as such due to the lack of support forAnnotatedTypein any JSON library currently available
-
-
Constructor Summary
Constructors Constructor Description IdAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectconvertInput(String substitute, AnnotatedType type, GlobalEnvironment environment, ValueMapper valueMapper)StringconvertOutput(Object original, AnnotatedType type, ResolutionEnvironment resolutionEnvironment)ObjectgetArgumentValue(ArgumentInjectorParams params)AnnotatedTypegetSubstituteType(AnnotatedType original)The returned type has to erase toClass<S>booleansupports(AnnotatedElement element, AnnotatedType type)booleansupports(AnnotatedType type)booleansupports(AnnotatedType type, Parameter parameter)graphql.schema.GraphQLInputTypetoGraphQLInputType(AnnotatedType javaType, Set<Class<? extends TypeMapper>> mappersToSkip, TypeMappingEnvironment env)graphql.schema.GraphQLOutputTypetoGraphQLType(AnnotatedType javaType, Set<Class<? extends TypeMapper>> mappersToSkip, TypeMappingEnvironment env)
-
-
-
Method Detail
-
toGraphQLType
public graphql.schema.GraphQLOutputType toGraphQLType(AnnotatedType javaType, Set<Class<? extends TypeMapper>> mappersToSkip, TypeMappingEnvironment env)
- Specified by:
toGraphQLTypein interfaceTypeMapper
-
toGraphQLInputType
public graphql.schema.GraphQLInputType toGraphQLInputType(AnnotatedType javaType, Set<Class<? extends TypeMapper>> mappersToSkip, TypeMappingEnvironment env)
- Specified by:
toGraphQLInputTypein interfaceTypeMapper
-
convertOutput
public String convertOutput(Object original, AnnotatedType type, ResolutionEnvironment resolutionEnvironment)
- Specified by:
convertOutputin interfaceOutputConverter<Object,String>
-
convertInput
public Object convertInput(String substitute, AnnotatedType type, GlobalEnvironment environment, ValueMapper valueMapper)
- Specified by:
convertInputin interfaceInputConverter<Object,String>
-
getArgumentValue
public Object getArgumentValue(ArgumentInjectorParams params)
- Specified by:
getArgumentValuein interfaceArgumentInjector
-
supports
public boolean supports(AnnotatedType type)
- Specified by:
supportsin interfaceInputConverter<Object,String>
-
supports
public boolean supports(AnnotatedType type, Parameter parameter)
- Specified by:
supportsin interfaceArgumentInjector
-
supports
public boolean supports(AnnotatedElement element, AnnotatedType type)
- Specified by:
supportsin interfaceOutputConverter<Object,String>- Specified by:
supportsin interfaceTypeMapper
-
getSubstituteType
public AnnotatedType getSubstituteType(AnnotatedType original)
Description copied from interface:InputConverterThe returned type has to erase toClass<S>- Specified by:
getSubstituteTypein interfaceInputConverter<Object,String>- Specified by:
getSubstituteTypein interfaceTypeSubstituter- Parameters:
original- The original type of the input value- Returns:
- The type of the input value this converter produces for the given original type
-
-