Added copyright and updated appropriate log levels
[vpnservice.git] / mdsalutil / mdsalutil-api / src / main / java / org / opendaylight / vpnservice / mdsalutil / MatchInfo.java
1 /*
2  * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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 package org.opendaylight.vpnservice.mdsalutil;
9
10 import java.io.Serializable;
11 import java.math.BigInteger;
12 import java.util.Map;
13
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
15
16 public class MatchInfo implements Serializable {
17     private static final long serialVersionUID = 1L;
18
19     private final MatchFieldType m_matchField;
20     private long[] m_alMatchValues;
21     private BigInteger[] m_aBigIntValues;
22     private String[] m_asMatchValues;
23
24     public MatchInfo(MatchFieldType matchField, long[] alMatchValues) {
25         m_matchField = matchField;
26         m_alMatchValues = alMatchValues;
27     }
28
29     public MatchInfo(MatchFieldType matchField, BigInteger[] alBigMatchValues) {
30         m_matchField = matchField;
31         m_aBigIntValues = alBigMatchValues;
32     }
33
34     public MatchInfo(MatchFieldType matchField, String[] alStringMatchValues) {
35         m_matchField = matchField;
36         m_asMatchValues = alStringMatchValues;
37     }
38
39     public void createInnerMatchBuilder(Map<Class<?>, Object> mapMatchBuilder) {
40         m_matchField.createInnerMatchBuilder(this, mapMatchBuilder);
41     }
42
43     public void setMatch(MatchBuilder matchBuilder, Map<Class<?>, Object> mapMatchBuilder) {
44         m_matchField.setMatch(matchBuilder, this, mapMatchBuilder);
45     }
46
47     public MatchFieldType getMatchField() {
48         return m_matchField;
49     }
50
51     public long[] getMatchValues() {
52         return m_alMatchValues;
53     }
54
55     public BigInteger[] getBigMatchValues() {
56         return m_aBigIntValues;
57     }
58
59     public String[] getStringMatchValues() {
60         return m_asMatchValues;
61     }
62 }