Merge "Added extensible implementation of Transformators"
[controller.git] / opendaylight / commons / concepts / src / main / java / org / opendaylight / controller / concepts / tranform / SimpleConditionalTransformer.java
1 /*\r
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 \r
9 package org.opendaylight.controller.concepts.tranform;\r
10 \r
11 /**\r
12  * Simple condition-based transformer\r
13  * \r
14  * The transformer provides {@link #isAcceptable(Object)} method,\r
15  * which could be used to query transformer if the input will produce\r
16  * result.\r
17  * \r
18  * This interface is simplified version of {@link RuleBasedTransformer} - does not\r
19  * provide decoupling of Acceptance rule from transformer, and should be used only\r
20  * for simple use-cases.\r
21  *  \r
22  * @author Tony Tkacik\r
23  *\r
24  * @param <I> Input class for transformation\r
25  * @param <P> Product of transformation\r
26  */\r
27 public interface SimpleConditionalTransformer<I,P> extends Transformer<I, P>, Acceptor<I> {\r
28 \r
29 \r
30     /**\r
31      * Checks if the input is acceptable \r
32      * for processing by the transformer.\r
33      * \r
34      * @return true it the input is acceptable for processing by transformer.\r
35      */\r
36     @Override\r
37     public boolean isAcceptable(I input);\r
38 }\r