Class MapToListTypeAdapter
- java.lang.Object
-
- io.leangen.graphql.generator.mapping.common.AbstractTypeSubstitutingMapper<S>
-
- io.leangen.graphql.generator.mapping.AbstractTypeAdapter<Map<?,?>,List<MapToListTypeAdapter.MapEntry<?,?>>>
-
- io.leangen.graphql.generator.mapping.common.MapToListTypeAdapter
-
- All Implemented Interfaces:
DelegatingOutputConverter<Map<?,?>,List<MapToListTypeAdapter.MapEntry<?,?>>>,InputConverter<Map<?,?>,List<MapToListTypeAdapter.MapEntry<?,?>>>,OutputConverter<Map<?,?>,List<MapToListTypeAdapter.MapEntry<?,?>>>,TypeMapper,TypeSubstituter
public class MapToListTypeAdapter extends AbstractTypeAdapter<Map<?,?>,List<MapToListTypeAdapter.MapEntry<?,?>>> implements DelegatingOutputConverter<Map<?,?>,List<MapToListTypeAdapter.MapEntry<?,?>>>
As maps are dynamic structures with no equivalent in GraphQL, they require special treatment. This adapter turns a map into a list of key-value pairs (instances ofMapToListTypeAdapter.MapEntry).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMapToListTypeAdapter.MapEntry<K,V>
-
Field Summary
-
Fields inherited from class io.leangen.graphql.generator.mapping.AbstractTypeAdapter
sourceType
-
Fields inherited from class io.leangen.graphql.generator.mapping.common.AbstractTypeSubstitutingMapper
substituteType
-
-
Constructor Summary
Constructors Constructor Description MapToListTypeAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<?,?>convertInput(List<MapToListTypeAdapter.MapEntry<?,?>> original, AnnotatedType type, GlobalEnvironment environment, ValueMapper valueMapper)List<MapToListTypeAdapter.MapEntry<?,?>>convertOutput(Map<?,?> original, AnnotatedType type, ResolutionEnvironment resolutionEnvironment)List<AnnotatedType>getDerivedTypes(AnnotatedType mapType)AnnotatedTypegetSubstituteType(AnnotatedType original)Returns the type to map instead of the original.booleansupports(AnnotatedType type)-
Methods inherited from class io.leangen.graphql.generator.mapping.AbstractTypeAdapter
supports
-
Methods inherited from class io.leangen.graphql.generator.mapping.common.AbstractTypeSubstitutingMapper
toGraphQLInputType, toGraphQLType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.leangen.graphql.generator.mapping.DelegatingOutputConverter
isTransparent
-
Methods inherited from interface io.leangen.graphql.generator.mapping.OutputConverter
supports
-
-
-
-
Method Detail
-
convertOutput
public List<MapToListTypeAdapter.MapEntry<?,?>> convertOutput(Map<?,?> original, AnnotatedType type, ResolutionEnvironment resolutionEnvironment)
- Specified by:
convertOutputin interfaceOutputConverter<Map<?,?>,List<MapToListTypeAdapter.MapEntry<?,?>>>
-
convertInput
public Map<?,?> convertInput(List<MapToListTypeAdapter.MapEntry<?,?>> original, AnnotatedType type, GlobalEnvironment environment, ValueMapper valueMapper)
- Specified by:
convertInputin interfaceInputConverter<Map<?,?>,List<MapToListTypeAdapter.MapEntry<?,?>>>
-
getSubstituteType
public AnnotatedType getSubstituteType(AnnotatedType original)
Description copied from class:AbstractTypeSubstitutingMapperReturns the type to map instead of the original. This implementation always returns the type of the generic type parameterS.- Specified by:
getSubstituteTypein interfaceInputConverter<Map<?,?>,List<MapToListTypeAdapter.MapEntry<?,?>>>- Specified by:
getSubstituteTypein interfaceTypeSubstituter- Overrides:
getSubstituteTypein classAbstractTypeSubstitutingMapper<List<MapToListTypeAdapter.MapEntry<?,?>>>- Parameters:
original- The type to be replaced- Returns:
- The substitute type to use for mapping
-
getDerivedTypes
public List<AnnotatedType> getDerivedTypes(AnnotatedType mapType)
- Specified by:
getDerivedTypesin interfaceDelegatingOutputConverter<Map<?,?>,List<MapToListTypeAdapter.MapEntry<?,?>>>
-
supports
public boolean supports(AnnotatedType type)
- Specified by:
supportsin interfaceInputConverter<Map<?,?>,List<MapToListTypeAdapter.MapEntry<?,?>>>- Overrides:
supportsin classAbstractTypeAdapter<Map<?,?>,List<MapToListTypeAdapter.MapEntry<?,?>>>
-
-