Add implementation for flat L3 overlay
[groupbasedpolicy.git] / renderers / vpp / src / main / java / org / opendaylight / groupbasedpolicy / renderer / vpp / lisp / loopback / SubnetHostInfo.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.groupbasedpolicy.renderer.vpp.lisp.loopback;
10
11 import com.google.common.base.Preconditions;
12
13 /**
14  * Created by Shakib Ahmed on 5/16/17.
15  */
16 public class SubnetHostInfo {
17     private String interfaceName;
18     private int portCount;
19
20     public SubnetHostInfo(String interfaceName) {
21         this.interfaceName = interfaceName;
22         this.portCount = 0;
23     }
24
25     public String getInterfaceName() {
26         return interfaceName;
27     }
28
29     public void setInterfaceName(String interfaceName) {
30         this.interfaceName = interfaceName;
31     }
32
33     public void incrementPortCount() {
34         portCount++;
35     }
36
37     public void decrementPortCount() {
38         Preconditions.checkArgument(portCount > 0, "No port to decrement");
39         portCount--;
40     }
41
42     public int incrementAndGetPortCount() {
43         incrementPortCount();
44         return portCount;
45     }
46
47     public int decrementAndGetPortCount() {
48         decrementPortCount();
49         return portCount;
50     }
51
52     public int getPortCount() {
53         return portCount;
54     }
55 }