Class OptionalAdapter
- java.lang.Object
-
- io.leangen.graphql.generator.mapping.common.AbstractTypeSubstitutingMapper<S>
-
- io.leangen.graphql.generator.mapping.AbstractTypeAdapter<T,S>
-
- io.leangen.graphql.generator.mapping.AbstractSimpleTypeAdapter<Optional<?>,Object>
-
- io.leangen.graphql.generator.mapping.common.OptionalAdapter
-
- All Implemented Interfaces:
DelegatingOutputConverter<Optional<?>,Object>
,InputConverter<Optional<?>,Object>
,OutputConverter<Optional<?>,Object>
,TypeMapper
,TypeSubstituter
,Comparator<AnnotatedType>
public class OptionalAdapter extends AbstractSimpleTypeAdapter<Optional<?>,Object> implements DelegatingOutputConverter<Optional<?>,Object>, Comparator<AnnotatedType>
- Author:
- Bojan Tomic (kaqqao)
-
-
Field Summary
-
Fields inherited from class io.leangen.graphql.generator.mapping.AbstractSimpleTypeAdapter
rawSourceType
-
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 OptionalAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(AnnotatedType o1, AnnotatedType o2)
Optional<?>
convertInput(Object substitute, AnnotatedType type, GlobalEnvironment environment, ValueMapper valueMapper)
Object
convertOutput(Optional<?> original, AnnotatedType type, ResolutionEnvironment env)
List<AnnotatedType>
getDerivedTypes(AnnotatedType type)
AnnotatedType
getSubstituteType(AnnotatedType original)
Returns the type to map instead of the original.-
Methods inherited from class io.leangen.graphql.generator.mapping.AbstractSimpleTypeAdapter
supports
-
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 java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
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 Object convertOutput(Optional<?> original, AnnotatedType type, ResolutionEnvironment env)
- Specified by:
convertOutput
in interfaceOutputConverter<Optional<?>,Object>
-
convertInput
public Optional<?> convertInput(Object substitute, AnnotatedType type, GlobalEnvironment environment, ValueMapper valueMapper)
- Specified by:
convertInput
in interfaceInputConverter<Optional<?>,Object>
-
getSubstituteType
public AnnotatedType getSubstituteType(AnnotatedType original)
Description copied from class:AbstractTypeSubstitutingMapper
Returns the type to map instead of the original. This implementation always returns the type of the generic type parameterS
.- Specified by:
getSubstituteType
in interfaceInputConverter<Optional<?>,Object>
- Specified by:
getSubstituteType
in interfaceTypeSubstituter
- Overrides:
getSubstituteType
in classAbstractTypeSubstitutingMapper<Object>
- Parameters:
original
- The type to be replaced- Returns:
- The substitute type to use for mapping
-
getDerivedTypes
public List<AnnotatedType> getDerivedTypes(AnnotatedType type)
- Specified by:
getDerivedTypes
in interfaceDelegatingOutputConverter<Optional<?>,Object>
-
compare
public int compare(AnnotatedType o1, AnnotatedType o2)
- Specified by:
compare
in interfaceComparator<AnnotatedType>
-
-