[SDC-29] Amdocs OnBoard 1707 initial commit.
[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 int hashCode() {
45     int result = name != null ? name.hashCode() : 0;
46     result = 31 * result + (dhcp ? 1 : 0);
47     return result;
48   }
49
50   @Override
51   public boolean equals(Object object) {
52     if (this == object) {
53       return true;
54     }
55     if (object == null || getClass() != object.getClass()) {
56       return false;
57     }
58
59     Network network = (Network) object;
60
61     if (dhcp != network.dhcp) {
62       return false;
63     }
64     return name != null ? name.equals(network.name) : network.name == null;
65
66   }
67 }