Checkstyle: fix issues and enforce on lisp-proto
[lispflowmapping.git] / mappingservice / lisp-proto / src / main / java / org / opendaylight / lispflowmapping / lisp / serializer / address / LispAddressSerializerContext.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc.  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.lispflowmapping.lisp.serializer.address;
9
10 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.InstanceIdType;
11
12 /**
13  * Class to pass around (de)serialization context information.
14  *
15  * @author Lorand Jakab
16  *
17  */
18 public class LispAddressSerializerContext {
19     public static final short MASK_LEN_MISSING = -1;
20     private InstanceIdType vni;
21     private short maskLen;
22
23     public LispAddressSerializerContext(InstanceIdType vni) {
24         this(vni, MASK_LEN_MISSING);
25     }
26
27     public LispAddressSerializerContext(short maskLen) {
28         this(null, maskLen);
29     }
30
31     public LispAddressSerializerContext(InstanceIdType vni, short maskLength) {
32         this.vni = vni;
33         this.maskLen = maskLength;
34     }
35
36     InstanceIdType getVni() {
37         return vni;
38     }
39
40     void setVni(InstanceIdType vni) {
41         this.vni = vni;
42     }
43
44     short getMaskLen() {
45         return maskLen;
46     }
47
48     void setMaskLen(short maskLen) {
49         this.maskLen = maskLen;
50     }
51 }