@Override public int typeHashCode() { return argument.typeHashCode(); }
@Override public int hashCode() { int result = type.typeHashCode(); result = 31 * result + annotation.hashCode(); return result; } }
@Override public <T> Optional<ArgumentBinder<T, HttpRequest<?>>> findArgumentBinder(Argument<T> argument, HttpRequest<?> source) { Optional<Class<? extends Annotation>> opt = argument.getAnnotationMetadata().getAnnotationTypeByStereotype(Bindable.class); if (opt.isPresent()) { Class<? extends Annotation> annotationType = opt.get(); RequestArgumentBinder<T> binder = findBinder(argument, annotationType); if (binder == null) { binder = byAnnotation.get(annotationType); } if (binder != null) { return Optional.of(binder); } } else { RequestArgumentBinder<T> binder = byType.get(argument.typeHashCode()); if (binder != null) { return Optional.of(binder); } else { binder = byType.get(Argument.of(argument.getType()).typeHashCode()); if (binder != null) { return Optional.of(binder); } } } return Optional.of(new ParameterAnnotationBinder<>(conversionService)); }
byType.put(typedRequestArgumentBinder.argumentType().typeHashCode(), typedRequestArgumentBinder); registerDefaultAnnotationBinders(byAnnotation); byType.put(Argument.of(HttpHeaders.class).typeHashCode(), (RequestArgumentBinder<HttpHeaders>) (argument, source) -> () -> Optional.of(source.getHeaders())); byType.put(Argument.of(HttpRequest.class).typeHashCode(), (RequestArgumentBinder<HttpRequest>) (argument, source) -> () -> Optional.of(source)); byType.put(Argument.of(HttpParameters.class).typeHashCode(), (RequestArgumentBinder<HttpParameters>) (argument, source) -> () -> Optional.of(source.getParameters())); byType.put(Argument.of(Cookies.class).typeHashCode(), (RequestArgumentBinder<Cookies>) (argument, source) -> () -> Optional.of(source.getCookies())); byType.put(Argument.of(Cookie.class).typeHashCode(), (RequestArgumentBinder<Cookie>) (context, source) -> { Cookies cookies = source.getCookies(); String name = context.getArgument().getName();
@Override public int hashCode() { int result = type.typeHashCode(); result = 31 * result + annotation.hashCode(); return result; } }
@Override public <T> Optional<ArgumentBinder<T, HttpRequest<?>>> findArgumentBinder(Argument<T> argument, HttpRequest<?> source) { Optional<Class<? extends Annotation>> opt = argument.getAnnotationMetadata().getAnnotationTypeByStereotype(Bindable.class); if (opt.isPresent()) { Class<? extends Annotation> annotationType = opt.get(); RequestArgumentBinder<T> binder = findBinder(argument, annotationType); if (binder == null) { binder = byAnnotation.get(annotationType); } if (binder != null) { return Optional.of(binder); } } else { RequestArgumentBinder<T> binder = byType.get(argument.typeHashCode()); if (binder != null) { return Optional.of(binder); } else { binder = byType.get(Argument.of(argument.getType()).typeHashCode()); if (binder != null) { return Optional.of(binder); } } } return Optional.of(new ParameterAnnotationBinder<>(conversionService)); }
byType.put(typedRequestArgumentBinder.argumentType().typeHashCode(), typedRequestArgumentBinder); registerDefaultAnnotationBinders(byAnnotation); byType.put(Argument.of(HttpHeaders.class).typeHashCode(), (RequestArgumentBinder<HttpHeaders>) (argument, source) -> () -> Optional.of(source.getHeaders())); byType.put(Argument.of(HttpRequest.class).typeHashCode(), (RequestArgumentBinder<HttpRequest>) (argument, source) -> () -> Optional.of(source)); byType.put(Argument.of(HttpParameters.class).typeHashCode(), (RequestArgumentBinder<HttpParameters>) (argument, source) -> () -> Optional.of(source.getParameters())); byType.put(Argument.of(Cookies.class).typeHashCode(), (RequestArgumentBinder<Cookies>) (argument, source) -> () -> Optional.of(source.getCookies())); byType.put(Argument.of(Cookie.class).typeHashCode(), (RequestArgumentBinder<Cookie>) (context, source) -> { Cookies cookies = source.getCookies(); String name = context.getArgument().getName();