4dd0841a1beee54f842cab813125193eed52fe2b
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / elements / Annotation.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 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.be.datatypes.elements;
22
23 import java.util.List;
24 import java.util.Map;
25 import java.util.Objects;
26
27 public class Annotation {
28     private String name;
29     private String type;
30     private String description;
31     private List<PropertyDataDefinition> properties;
32
33     public String getName() {
34         return name;
35     }
36
37     public void setName(String name) {
38         this.name = name;
39     }
40
41     public String getType() {
42         return type;
43     }
44
45     public void setType(String type) {
46         this.type = type;
47     }
48
49     public List<PropertyDataDefinition> getProperties() {
50         return properties;
51     }
52
53     public void setProperties(List<PropertyDataDefinition> properties) {
54         this.properties = properties;
55     }
56
57     public String getDescription() {
58         return description;
59     }
60
61     public void setDescription(String description) {
62         this.description = description;
63     }
64
65     public static void setAnnotationsName(Map<String, Annotation> annotations) {
66         annotations.forEach((name, annotation) -> annotation.setName(name));
67     }
68
69     @Override
70     public boolean equals(Object o) {
71         if (this == o) {
72             return true;
73         }
74         if (o == null || getClass() != o.getClass()) {
75             return false;
76         }
77         Annotation that = (Annotation) o;
78         return Objects.equals(name, that.name);
79     }
80
81     @Override
82     public int hashCode() {
83         return Objects.hash(name);
84     }
85 }