Added extensible implementation of Transformators
[controller.git] / opendaylight / commons / concepts / src / main / java / org / opendaylight / controller / concepts / tranform / InputClassBasedTransformer.java
diff --git a/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/tranform/InputClassBasedTransformer.java b/opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/tranform/InputClassBasedTransformer.java
new file mode 100644 (file)
index 0000000..1b8d1f0
--- /dev/null
@@ -0,0 +1,38 @@
+/*\r
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+package org.opendaylight.controller.concepts.tranform;\r
+\r
+/**\r
+ * Input class based transformer\r
+ * \r
+ * {@link Transformer} which accepts / transforms only specific classes of\r
+ * input, and is useful if the selection of transformer should be based on the\r
+ * class of the input and there is one-to-one mapping between input class and\r
+ * transformer.\r
+ * \r
+ * \r
+ * @author Tony Tkacik\r
+ * \r
+ * @param <S>\r
+ *            Common supertype of input\r
+ * @param <I>\r
+ *            Concrete type of input\r
+ * @param <P>\r
+ *            Product\r
+ */\r
+public interface InputClassBasedTransformer<S, I extends S, P> extends\r
+        Transformer<I, P> {\r
+\r
+    /**\r
+     * Returns an {@link Class} of input which is acceptable for transformation.\r
+     * \r
+     * @return {@link Class} of input which is acceptable for transformation.\r
+     */\r
+    Class<? extends S> getInputClass();\r
+}\r