Class ParameterTypeContext

java.lang.Object
com.pholser.junit.quickcheck.internal.ParameterTypeContext

public class ParameterTypeContext extends Object
  • Field Details

    • EXPLICIT_GENERATOR_TYPE_MISMATCH_MESSAGE

      private static final String EXPLICIT_GENERATOR_TYPE_MISMATCH_MESSAGE
      See Also:
    • zilch

      private static Zilch zilch
    • parameterName

      private final String parameterName
    • parameterType

      private final AnnotatedType parameterType
    • declarerName

      private final String declarerName
    • resolved

      private final io.arxila.javaruntype.type.Type<?> resolved
    • explicits

      private final List<Weighted<Generator<?>>> explicits
    • generics

      private final ru.vyarus.java.generics.resolver.context.GenericsContext generics
    • parameterIndex

      private final int parameterIndex
    • annotatedElement

      private AnnotatedElement annotatedElement
    • allowMixedTypes

      private boolean allowMixedTypes
  • Constructor Details

    • ParameterTypeContext

      private ParameterTypeContext(String parameterName, AnnotatedType parameterType, String declarerName, io.arxila.javaruntype.type.Type<?> resolvedType, ru.vyarus.java.generics.resolver.context.GenericsContext generics)
    • ParameterTypeContext

      private ParameterTypeContext(String parameterName, AnnotatedType parameterType, String declarerName, io.arxila.javaruntype.type.Type<?> resolvedType, ru.vyarus.java.generics.resolver.context.GenericsContext generics, int parameterIndex)
  • Method Details

    • forClass

      public static ParameterTypeContext forClass(Class<?> clazz)
    • forField

      public static ParameterTypeContext forField(Field field)
    • forParameter

      public static ParameterTypeContext forParameter(Parameter parameter)
    • forParameter

      public static ParameterTypeContext forParameter(Parameter parameter, ru.vyarus.java.generics.resolver.context.MethodGenericsContext generics)
    • parameterIndex

      private static int parameterIndex(Executable exec, Parameter parameter)
    • annotate

      public ParameterTypeContext annotate(AnnotatedElement element)
    • allowMixedTypes

      public ParameterTypeContext allowMixedTypes(boolean value)
    • allowMixedTypes

      public boolean allowMixedTypes()
    • methodReturnTypeContext

      public ParameterTypeContext methodReturnTypeContext(Method method)
      Gives a context for generation of the return type of a lambda method.
      Parameters:
      method - method whose return type we want to resolve
      Returns:
      an associated parameter context
    • addGenerators

      private void addGenerators(List<From> generators)
    • makeGenerator

      private Generator<?> makeGenerator(Class<? extends Generator> generatorType)
    • rawParameterType

      private Class<?> rawParameterType()
    • ensureCorrectType

      private void ensureCorrectType(Generator<?> generator)
    • name

      public String name()
    • annotatedType

      public AnnotatedType annotatedType()
    • type

      public Type type()
    • annotatedElement

      @Deprecated public AnnotatedElement annotatedElement()
      Deprecated.
      This will likely go away when languages whose compilers and interpreters produce class files that support annotations on type uses.
      Returns:
      the annotated program element this context represents
      See Also:
    • topLevel

      @Deprecated public boolean topLevel()
      Deprecated.
      This will likely go away when languages whose compilers and interpreters produce class files that support annotations on type uses.
      Returns:
      the annotated program element this context represents
      See Also:
    • explicitGenerators

      public List<Weighted<Generator<?>>> explicitGenerators()
    • arrayComponentContext

      public ParameterTypeContext arrayComponentContext()
    • annotatedArrayComponent

      private AnnotatedType annotatedArrayComponent(io.arxila.javaruntype.type.Type<?> component)
    • isArray

      public boolean isArray()
    • getRawClass

      public Class<?> getRawClass()
    • isEnum

      public boolean isEnum()
    • getTypeParameters

      public List<io.arxila.javaruntype.type.TypeParameter<?>> getTypeParameters()
    • typeParameterContexts

      public List<ParameterTypeContext> typeParameterContexts(SourceOfRandomness random)
    • addStandardTypeParameterContext

      private void addStandardTypeParameterContext(List<ParameterTypeContext> typeParameterContexts, io.arxila.javaruntype.type.TypeParameter<?> p, AnnotatedType a)
    • addWildcardTypeParameterContext

      private void addWildcardTypeParameterContext(List<ParameterTypeContext> typeParameterContexts, AnnotatedType a)
    • addExtendsTypeParameterContext

      private void addExtendsTypeParameterContext(List<ParameterTypeContext> typeParameterContexts, io.arxila.javaruntype.type.TypeParameter<?> p, AnnotatedType a)
    • addSuperTypeParameterContext

      private void addSuperTypeParameterContext(SourceOfRandomness random, List<ParameterTypeContext> typeParameterContexts, io.arxila.javaruntype.type.TypeParameter<?> p, AnnotatedType a)
    • zilch

      private static AnnotatedType zilch()