Example usage for org.springframework.integration.util ClassUtils findClosestMatch

List of usage examples for org.springframework.integration.util ClassUtils findClosestMatch

Introduction

In this page you can find the example usage for org.springframework.integration.util ClassUtils findClosestMatch.

Prototype

public static Class<?> findClosestMatch(Class<?> type, Set<Class<?>> candidates, boolean failOnTie) 

Source Link

Usage

From source file:org.springframework.integration.handler.support.MessagingMethodInvokerHelper.java

private HandlerMethod findClosestMatch(Class<?> payloadType) {
    for (Map<Class<?>, HandlerMethod> handlerMethods : this.handlerMethodsList) {
        Set<Class<?>> candidates = handlerMethods.keySet();
        Class<?> match = null;
        if (!CollectionUtils.isEmpty(candidates)) {
            match = ClassUtils.findClosestMatch(payloadType, candidates, true);
        }/*w ww  .  jav  a 2  s . c om*/
        if (match != null) {
            return handlerMethods.get(match);
        }
    }
    return null;
}

From source file:org.springframework.integration.util.MessagingMethodInvokerHelper.java

private HandlerMethod findClosestMatch(Class<?> payloadType) {
    Set<Class<?>> candidates = this.handlerMethods.keySet();
    Class<?> match = null;/*from  w  w  w.  j a v a2 s.c  o  m*/
    if (candidates != null && !candidates.isEmpty()) {
        match = ClassUtils.findClosestMatch(payloadType, candidates, true);
    }
    return (match != null) ? this.handlerMethods.get(match) : null;
}