Add @FunctionalInterface on candidate interfaces

Issue: SPR-14432
This commit is contained in:
Stephane Nicoll
2016-07-06 14:32:13 +02:00
parent 912b63ad44
commit e4b0486c5a
110 changed files with 199 additions and 84 deletions

View File

@@ -145,6 +145,7 @@ public interface Cache {
/**
* A (wrapper) object representing a cache value.
*/
@FunctionalInterface
interface ValueWrapper {
/**

View File

@@ -181,6 +181,7 @@ public class AnnotationCacheOperationSource extends AbstractFallbackCacheOperati
* Callback interface providing {@link CacheOperation} instance(s) based on
* a given {@link CacheAnnotationParser}.
*/
@FunctionalInterface
protected interface CacheOperationProvider {
/**

View File

@@ -27,6 +27,7 @@ package org.springframework.cache.interceptor;
* @author Stephane Nicoll
* @since 4.1
*/
@FunctionalInterface
public interface CacheOperationInvoker {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@ import org.springframework.cache.Cache;
* @author Stephane Nicoll
* @since 4.1
*/
@FunctionalInterface
public interface CacheResolver {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ import java.lang.reflect.Method;
* @author Phillip Webb
* @since 3.1
*/
@FunctionalInterface
public interface KeyGenerator {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@ import java.util.EventListener;
* @param <E> the specific ApplicationEvent subclass to listen to
* @see org.springframework.context.event.ApplicationEventMulticaster
*/
@FunctionalInterface
public interface ApplicationListener<E extends ApplicationEvent> extends EventListener {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,6 +38,7 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
* @see Conditional
* @see ConditionContext
*/
@FunctionalInterface
public interface Condition {
/**

View File

@@ -151,6 +151,7 @@ class ConfigurationClassEnhancer {
* must remain public in order to allow access to subclasses generated from other
* packages (i.e. user code).
*/
@FunctionalInterface
public interface EnhancedConfiguration extends BeanFactoryAware {
}
@@ -159,6 +160,7 @@ class ConfigurationClassEnhancer {
* Conditional {@link Callback}.
* @see ConditionalCallbackFilter
*/
@FunctionalInterface
private interface ConditionalCallback extends Callback {
boolean isMatch(Method candidateMethod);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@ import org.springframework.beans.factory.config.BeanDefinition;
* @since 2.5
* @see org.springframework.context.annotation.Scope
*/
@FunctionalInterface
public interface ScopeMetadataResolver {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ import java.util.Locale;
* @since 3.0
* @param <T> the type of object this Parser produces
*/
@FunctionalInterface
public interface Parser<T> {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@ import java.util.Locale;
* @since 3.0
* @param <T> the type of object this Printer prints
*/
@FunctionalInterface
public interface Printer<T> {
/**

View File

@@ -1077,7 +1077,8 @@ public class MBeanExporter extends MBeanRegistrationSupport implements MBeanExpo
/**
* Internal callback interface for the autodetection process.
*/
private static interface AutodetectCallback {
@FunctionalInterface
private interface AutodetectCallback {
/**
* Called during the autodetection process to decide whether

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@ import javax.management.ObjectName;
* @see org.springframework.jmx.export.MBeanExporter
* @see javax.management.ObjectName
*/
@FunctionalInterface
public interface ObjectNamingStrategy {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,6 +42,7 @@ import javax.management.Notification;
* @see NotificationPublisherAware
* @see org.springframework.jmx.export.MBeanExporter
*/
@FunctionalInterface
public interface NotificationPublisher {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@ import javax.naming.NamingException;
* @see JndiTemplate
* @see org.springframework.jdbc.core.JdbcTemplate
*/
@FunctionalInterface
public interface JndiCallback<T> {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,6 +36,7 @@ import org.springframework.scheduling.config.ScheduledTaskRegistrar;
* @see EnableScheduling
* @see ScheduledTaskRegistrar
*/
@FunctionalInterface
public interface SchedulingConfigurer {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@ import groovy.lang.GroovyObject;
* @since 2.0.2
* @see GroovyScriptFactory
*/
@FunctionalInterface
public interface GroovyObjectCustomizer {
/**