a5b5c0c631ae6fdf212084319bf0b3955da2a093
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / domain / BEProperty.java
1 /*-
2  * ================================================================================
3  * ECOMP Portal
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property
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  * ================================================================================
19  */
20 package org.openecomp.portalapp.portal.domain;
21
22 public class BEProperty {
23         private String key;
24         private String value;
25
26         public BEProperty(String key, String value) {
27                 this.key = key;
28                 this.value = value;
29         }
30
31         public String getKey() {
32                 return key;
33         }
34
35         public void setKey(String key) {
36                 this.key = key;
37         }
38
39         public String getValue() {
40                 return value;
41         }
42
43         public void setValue(String value) {
44                 this.value = value;
45         }
46
47         @Override
48         public int hashCode() {
49                 final int prime = 31;
50                 int result = 1;
51                 result = prime * result + ((key == null) ? 0 : key.hashCode());
52                 result = prime * result + ((value == null) ? 0 : value.hashCode());
53                 return result;
54         }
55
56         @Override
57         public boolean equals(Object obj) {
58                 if (this == obj)
59                         return true;
60                 if (obj == null)
61                         return false;
62                 if (getClass() != obj.getClass())
63                         return false;
64                 BEProperty other = (BEProperty) obj;
65                 if (key == null) {
66                         if (other.key != null)
67                                 return false;
68                 } else if (!key.equals(other.key))
69                         return false;
70                 if (value == null) {
71                         if (other.value != null)
72                                 return false;
73                 } else if (!value.equals(other.value))
74                         return false;
75                 return true;
76         }
77
78 }