Example usage for org.springframework.web.method HandlerMethod equals

List of usage examples for org.springframework.web.method HandlerMethod equals

Introduction

In this page you can find the example usage for org.springframework.web.method HandlerMethod equals.

Prototype

@Override
    public boolean equals(@Nullable Object other) 

Source Link

Usage

From source file:org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.java

@Override
protected CorsConfiguration getCorsConfiguration(Object handler, HttpServletRequest request) {
    CorsConfiguration corsConfig = super.getCorsConfiguration(handler, request);
    if (handler instanceof HandlerMethod) {
        HandlerMethod handlerMethod = (HandlerMethod) handler;
        if (handlerMethod.equals(PREFLIGHT_AMBIGUOUS_MATCH)) {
            return AbstractHandlerMethodMapping.ALLOW_CORS_CONFIG;
        } else {//from w  ww  .  j  a v a 2 s . c o  m
            CorsConfiguration corsConfigFromMethod = this.mappingRegistry.getCorsConfiguration(handlerMethod);
            corsConfig = (corsConfig != null ? corsConfig.combine(corsConfigFromMethod) : corsConfigFromMethod);
        }
    }
    return corsConfig;
}