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

@@ -146,6 +146,7 @@ public abstract class MethodIntrospector {
* A callback interface for metadata lookup on a given method.
* @param <T> the type of metadata returned
*/
@FunctionalInterface
public interface MetadataLookup<T> {
/**

View File

@@ -203,6 +203,7 @@ public class OrderComparator implements Comparator<Object> {
* Strategy interface to provide an order source for a given object.
* @since 4.1
*/
@FunctionalInterface
public interface OrderSourceProvider {
/**

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 @@ package org.springframework.core.convert.converter;
* @param <S> the source type
* @param <T> the target type
*/
@FunctionalInterface
public interface Converter<S, T> {
/**

View File

@@ -27,6 +27,7 @@ package org.springframework.core.io;
* @since 4.3
* @see DefaultResourceLoader#addProtocolResolver
*/
@FunctionalInterface
public interface ProtocolResolver {
/**

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.io.InputStream;
* @author Mark Fisher
* @since 3.0.5
*/
@FunctionalInterface
public interface Deserializer<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.
@@ -26,6 +26,7 @@ import java.io.OutputStream;
* @author Mark Fisher
* @since 3.0.5
*/
@FunctionalInterface
public interface Serializer<T> {
/**

View File

@@ -32,6 +32,7 @@ package org.springframework.core.task;
* @see TaskExecutor#execute(Runnable)
* @see SimpleAsyncTaskExecutor#setTaskDecorator
*/
@FunctionalInterface
public interface TaskDecorator {
/**

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.
@@ -35,6 +35,7 @@ import java.util.concurrent.Executor;
* @since 2.0
* @see java.util.concurrent.Executor
*/
@FunctionalInterface
public interface TaskExecutor extends Executor {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 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 org.springframework.core.type.classreading.MetadataReaderFactory;
* @author Mark Fisher
* @since 2.5
*/
@FunctionalInterface
public interface TypeFilter {
/**

View File

@@ -243,6 +243,7 @@ public class AutoPopulatingList<E> implements List<E>, Serializable {
* Factory interface for creating elements for an index-based access
* data structure such as a {@link java.util.List}.
*/
@FunctionalInterface
public interface ElementFactory<E> {
/**

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 @@ package org.springframework.util;
* @author Mark Fisher
* @since 3.0
*/
@FunctionalInterface
public interface ErrorHandler {
/**

View File

@@ -212,7 +212,8 @@ public class PropertyPlaceholderHelper {
/**
* Strategy interface used to resolve replacement values for placeholders contained in Strings.
*/
public static interface PlaceholderResolver {
@FunctionalInterface
public interface PlaceholderResolver {
/**
* Resolve the supplied placeholder name to the replacement value.

View File

@@ -755,6 +755,7 @@ public abstract class ReflectionUtils {
/**
* Action to take on each method.
*/
@FunctionalInterface
public interface MethodCallback {
/**
@@ -768,6 +769,7 @@ public abstract class ReflectionUtils {
/**
* Callback optionally used to filter methods to be operated on by a method callback.
*/
@FunctionalInterface
public interface MethodFilter {
/**
@@ -781,6 +783,7 @@ public abstract class ReflectionUtils {
/**
* Callback interface invoked on each field in the hierarchy.
*/
@FunctionalInterface
public interface FieldCallback {
/**
@@ -794,6 +797,7 @@ public abstract class ReflectionUtils {
/**
* Callback optionally used to filter fields to be operated on by a field callback.
*/
@FunctionalInterface
public interface FieldFilter {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 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 @@ package org.springframework.util;
* @see org.springframework.beans.factory.config.BeanDefinitionVisitor#BeanDefinitionVisitor(StringValueResolver)
* @see org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
*/
@FunctionalInterface
public interface StringValueResolver {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 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.
@@ -43,6 +43,7 @@ package org.springframework.util.backoff;
* @since 4.1
* @see BackOffExecution
*/
@FunctionalInterface
public interface BackOff {
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 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 @@ package org.springframework.util.backoff;
* @since 4.1
* @see BackOff
*/
@FunctionalInterface
public interface BackOffExecution {
/**

View File

@@ -22,6 +22,7 @@ package org.springframework.util.concurrent;
* @author Sebastien Deleuze
* @since 4.1
*/
@FunctionalInterface
public interface FailureCallback {
/**

View File

@@ -22,6 +22,7 @@ package org.springframework.util.concurrent;
* @author Sebastien Deleuze
* @since 4.1
*/
@FunctionalInterface
public interface SuccessCallback<T> {
/**