Containerization feature of SO
[so.git] / adapters / mso-adapter-utils / src / main / java / org / onap / so / openstack / utils / MsoHeatEnvironmentParameter.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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.onap.so.openstack.utils;
22
23 import java.util.Objects;
24
25 public class MsoHeatEnvironmentParameter {
26
27         private String name;
28         private String value;
29         
30         public MsoHeatEnvironmentParameter(String name, String value) {
31                 super();
32                 this.name = name;
33                 this.value = value;
34         }
35         public MsoHeatEnvironmentParameter(String name) {
36                 // Allow to initialize with a null value
37                 this(name, null);
38         }
39         public MsoHeatEnvironmentParameter() {
40                 this(null, null);
41         }
42         
43         public String getName() {
44                 return this.name;
45         }
46         public void setName(String name) {
47                 this.name = name;
48         }
49         
50         public String getValue() {
51                 return this.value;
52         }
53         public void setValue(String value) {
54                 this.value = value;
55         }
56         public String toString() {
57                 return this.name + ": " + this.value;
58         }
59         
60         public boolean equals(Object o) {       
61                 if (!(o instanceof MsoHeatEnvironmentParameter)) {
62                         return false;
63                 }
64                 if (this == o) {
65                         return true;
66                 }
67                 MsoHeatEnvironmentParameter hep = (MsoHeatEnvironmentParameter) o;      
68                 // If the name of the parameter is the same, then they're equal
69         return hep.getName().equals(this.getName());
70         }
71         
72         public int hashCode() {
73         return Objects.hashCode(this.name);
74         }
75
76
77 }