push addional code
[sdc.git] / openecomp-be / lib / openecomp-sdc-vendor-software-product-lib / openecomp-sdc-vendor-software-product-api / src / main / java / org / openecomp / sdc / vendorsoftwareproduct / types / composition / Network.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.vendorsoftwareproduct.types.composition;
22
23 public class Network implements CompositionDataEntity {
24   private String name;
25   private boolean dhcp;
26
27   public String getName() {
28     return name;
29   }
30
31   public void setName(String name) {
32     this.name = name;
33   }
34
35   public boolean isDhcp() {
36     return dhcp;
37   }
38
39   public void setDhcp(boolean dhcp) {
40     this.dhcp = dhcp;
41   }
42
43   @Override
44   public boolean equals(Object obj) {
45     if (this == obj) {
46       return true;
47     }
48     if (obj == null || getClass() != obj.getClass()) {
49       return false;
50     }
51
52     Network network = (Network) obj;
53
54     if (dhcp != network.dhcp) {
55       return false;
56     }
57     return name != null ? name.equals(network.name) : network.name == null;
58
59   }
60
61   @Override
62   public int hashCode() {
63     int result = name != null ? name.hashCode() : 0;
64     result = 31 * result + (dhcp ? 1 : 0);
65     return result;
66   }
67 }