INT-3293: Add Lambda Strategies

JIRA: https://jira.springsource.org/browse/INT-3293
This commit is contained in:
Artem Bilan
2014-02-10 19:10:02 +02:00
committed by Gary Russell
parent 8cbaef7c6b
commit 814caea5d5
4 changed files with 67 additions and 4 deletions

View File

@@ -0,0 +1,31 @@
/*
* Copyright 2002-2010 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.core;
/**
* Generic (lambda) strategy interface for selector.
*
* @param <S> the source type to accept.
*
* @author Artem Bilan
* @since 4.0
*/
public interface GenericSelector<S> {
boolean accept(S source);
}

View File

@@ -20,10 +20,10 @@ import org.springframework.messaging.Message;
/**
* Strategy interface for message selection.
*
*
* @author Mark Fisher
*/
public interface MessageSelector {
public interface MessageSelector extends GenericSelector<Message<?>> {
boolean accept(Message<?> message);

View File

@@ -0,0 +1,32 @@
/*
* Copyright 2014 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.transformer;
/**
* Generic (lambda) strategy interface for transformer.
*
* @param <S> the source type - 'transform from'.
* @param <T> the target type - 'transform to'.
*
* @author Artem Bilan
* @since 4.0
*/
public interface GenericTransformer<S, T> {
T transform(S source);
}

View File

@@ -20,10 +20,10 @@ import org.springframework.messaging.Message;
/**
* Strategy interface for transforming a {@link Message}.
*
*
* @author Mark Fisher
*/
public interface Transformer {
public interface Transformer extends GenericTransformer<Message<?>, Message<?>> {
Message<?> transform(Message<?> message);