Bug 5540 - PortConvertor, MatchConvertor
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / sal / convertor / match / MatchReactor.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match;
10
11 import java.util.Map;
12 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertReactor;
13 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.Convertor;
14 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.InjectionKey;
15 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ResultInjector;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.Match;
17
18 /**
19  *
20  */
21 public class MatchReactor extends ConvertReactor<Match> {
22
23     private static final MatchReactor INSTANCE = new MatchReactor();
24
25     private MatchReactor() {
26         //NOOP
27     }
28
29     /**
30      * @return singleton
31      */
32     public static MatchReactor getInstance() {
33         return INSTANCE;
34     }
35
36     @Override
37     protected void initMappings(final Map<Short, Convertor<Match, ?>> conversions,
38                                 final Map<InjectionKey, ResultInjector<?, ?>> injections) {
39         MatchReactorMappingFactory.addMatchConvertors(conversions);
40         MatchReactorMappingFactory.addMatchIjectors(injections);
41     }
42 }