Class AbstractAssignabilityRules

    • Constructor Detail

      • AbstractAssignabilityRules

        public AbstractAssignabilityRules()
    • Method Detail

      • matches

        public boolean matches​(Set<Type> requiredTypes,
                               Set<Type> beanTypes)
        Description copied from interface: AssignabilityRules
        Check whether at least one of the requiredTypes matches a type in beanTypes
        Specified by:
        matches in interface AssignabilityRules
        Parameters:
        requiredTypes - the requiredTypes
        beanTypes - the beanTypes
        Returns:
        can we assign some type from requiredTypes to some type in beanTypes
      • matches

        public boolean matches​(Type requiredType,
                               Set<? extends Type> beanTypes)
        Description copied from interface: AssignabilityRules
        Check whether requiredType matches a type in beanTypes
        Specified by:
        matches in interface AssignabilityRules
        Parameters:
        requiredType - the requiredType
        beanTypes - the beanTypes
        Returns:
        can we assign requiredType to some type in beanTypes
      • getUppermostTypeVariableBounds

        protected Type[] getUppermostTypeVariableBounds​(TypeVariable<?> bound)
      • boundsMatch

        protected boolean boundsMatch​(Type[] upperBounds,
                                      Type[] stricterUpperBounds)
        Returns true iff for each upper bound T, there is at least one bound from stricterUpperBounds assignable to T. This reflects that stricterUpperBounds are at least as strict as upperBounds are.

        Arguments passed to this method must be legal java bounds, i.e. bounds returned by TypeVariable.getBounds(), WildcardType.getUpperBounds() or WildcardType.getLowerBounds().

      • lowerBoundsOfWildcardMatch

        protected boolean lowerBoundsOfWildcardMatch​(Type parameter,
                                                     WildcardType requiredParameter)
      • lowerBoundsOfWildcardMatch

        protected boolean lowerBoundsOfWildcardMatch​(Type[] beanParameterBounds,
                                                     WildcardType requiredParameter)
      • upperBoundsOfWildcardMatch

        protected boolean upperBoundsOfWildcardMatch​(WildcardType requiredParameter,
                                                     Type parameter)