Replaced all tabs with spaces in java and pom.xml
[so.git] / adapters / mso-adapter-utils / src / main / java / org / onap / so / openstack / utils / MsoHeatEnvironmentResource.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
7  * ================================================================================
8  * Modifications Copyright (c) 2019 Samsung
9  * ================================================================================
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  * 
14  *      http://www.apache.org/licenses/LICENSE-2.0
15  * 
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  * ============LICENSE_END=========================================================
22  */
23
24 package org.onap.so.openstack.utils;
25
26 import org.slf4j.Logger;
27 import org.slf4j.LoggerFactory;
28
29 public class MsoHeatEnvironmentResource {
30
31     private static final Logger logger = LoggerFactory.getLogger(MsoHeatEnvironmentResource.class);
32
33     private String name;
34     private String value;
35
36     public MsoHeatEnvironmentResource(String name, String value) {
37         super();
38         this.name = name;
39         this.value = value;
40     }
41
42     public MsoHeatEnvironmentResource(String name) {
43         // Allow to initialize with a null value
44         this(name, null);
45     }
46
47     public MsoHeatEnvironmentResource() {
48         this(null, null);
49     }
50
51     public String getName() {
52         return this.name;
53     }
54
55     public void setName(String name) {
56         this.name = name;
57     }
58
59     public String getValue() {
60         return this.value;
61     }
62
63     public void setValue(String value) {
64         this.value = value;
65     }
66
67     @Override
68     public String toString() {
69         return "\"" + this.name + "\": " + this.value;
70     }
71
72     @Override
73     public boolean equals(Object o) {
74         if (!(o instanceof MsoHeatEnvironmentResource)) {
75             return false;
76         }
77         if (this == o) {
78             return true;
79         }
80         MsoHeatEnvironmentResource her = (MsoHeatEnvironmentResource) o;
81         // If the name of the parameter is the same, then they're equal
82         if (her.getName().equals(this.getName())) {
83             return true;
84         }
85         return false;
86     }
87
88     @Override
89     public int hashCode() {
90         int result = 0;
91         try {
92             result = this.name.hashCode();
93         } catch (Exception e) {
94             logger.debug("Exception:", e);
95         }
96         return result;
97     }
98
99
100 }