dhcpservice dead code removal
[netvirt.git] / dhcpservice / impl / src / main / java / org / opendaylight / netvirt / dhcpservice / DhcpInfo.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.netvirt.dhcpservice;
9
10 import java.util.ArrayList;
11 import java.util.List;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnet.attributes.HostRoutes;
14
15 public class DhcpInfo  {
16     private String clientIp;
17     private String serverIp;
18     private String gatewayIp;
19     private String cidr;
20     private List<String> dnsServers;
21     private List<HostRoutes> hostRoutes;
22
23     public DhcpInfo() {
24         //Empty constructor
25     }
26
27     protected DhcpInfo setClientIp(String clientIp) {
28         this.clientIp = clientIp;
29         return this;
30     }
31
32     protected DhcpInfo setCidr(String cidr) {
33         this.cidr = cidr;
34         return this;
35     }
36
37     protected DhcpInfo setServerIp(String serverIp) {
38         this.serverIp = serverIp;
39         return this;
40     }
41
42     protected DhcpInfo setGatewayIp(String gwIp) {
43         gatewayIp = gwIp;
44         return this;
45     }
46
47     protected DhcpInfo setHostRoutes(List<HostRoutes> hostRoutes) {
48         this.hostRoutes = hostRoutes;
49         return this;
50     }
51
52     protected DhcpInfo setDnsServersIpAddrs(List<IpAddress> dnsServersIpAddrs) {
53         for (IpAddress ipAddr: dnsServersIpAddrs) {
54             addDnsServer(ipAddr.getIpv4Address().getValue());
55         }
56         return this;
57     }
58
59     protected DhcpInfo addDnsServer(String dnsServerIp) {
60         if (dnsServers == null) {
61             dnsServers = new ArrayList<>();
62         }
63         dnsServers.add(dnsServerIp);
64         return this;
65     }
66
67
68     protected String getClientIp() {
69         return clientIp;
70     }
71
72     protected String getCidr() {
73         return cidr;
74     }
75
76     protected String getServerIp() {
77         return serverIp;
78     }
79
80     protected String getGatewayIp() {
81         return gatewayIp;
82     }
83
84     protected List<String> getDnsServers() {
85         return dnsServers;
86     }
87
88     protected List<HostRoutes> getHostRoutes() {
89         return hostRoutes;
90     }
91
92 }