Unit Tests
[sdc.git] / openecomp-be / lib / openecomp-core-lib / openecomp-zusammen-lib / openecomp-zusammen-plugin / src / main / java / org / openecomp / core / zusammen / plugin / dao / types / ElementEntity.java
1 /*
2  * Copyright © 2016-2017 European Support Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.openecomp.core.zusammen.plugin.dao.types;
18
19 import com.amdocs.zusammen.datatypes.Id;
20 import com.amdocs.zusammen.datatypes.Namespace;
21 import com.amdocs.zusammen.datatypes.item.Info;
22 import com.amdocs.zusammen.datatypes.item.Relation;
23
24 import java.nio.ByteBuffer;
25 import java.util.Collection;
26 import java.util.Collections;
27 import java.util.Set;
28
29 public class ElementEntity {
30   private Id id;
31   private Id parentId;
32   private Namespace namespace;
33   private Id elementHash;
34   private Info info;
35   private Collection<Relation> relations = Collections.emptyList();
36   private ByteBuffer data;
37   private ByteBuffer searchableData;
38   private ByteBuffer visualization;
39   private Set<Id> subElementIds = Collections.emptySet();
40
41   public ElementEntity(Id id) {
42     this.id = id;
43   }
44
45   public Id getId() {
46     return id;
47   }
48
49   public Id getParentId() {
50     return parentId;
51   }
52
53   public void setParentId(Id parentId) {
54     this.parentId = parentId;
55   }
56
57   public Namespace getNamespace() {
58     return namespace;
59   }
60
61   public void setNamespace(Namespace namespace) {
62     this.namespace = namespace;
63   }
64
65   public Info getInfo() {
66     return info;
67   }
68
69   public void setInfo(Info info) {
70     this.info = info;
71   }
72
73   public Collection<Relation> getRelations() {
74     return relations;
75   }
76
77   public void setRelations(Collection<Relation> relations) {
78     this.relations = relations;
79   }
80
81   public ByteBuffer getData() {
82     return data;
83   }
84
85   public void setData(ByteBuffer data) {
86     this.data = data;
87   }
88
89   public ByteBuffer getSearchableData() {
90     return searchableData;
91   }
92
93   public void setSearchableData(ByteBuffer searchableData) {
94     this.searchableData = searchableData;
95   }
96
97   public ByteBuffer getVisualization() {
98     return visualization;
99   }
100
101   public void setVisualization(ByteBuffer visualization) {
102     this.visualization = visualization;
103   }
104
105   public Set<Id> getSubElementIds() {
106     return subElementIds;
107   }
108
109   public void setSubElementIds(Set<Id> subElementIds) {
110     this.subElementIds = subElementIds;
111   }
112
113   @Override
114   public boolean equals(Object o) {
115     if (this == o) {
116       return true;
117     }
118     if (o == null || getClass() != o.getClass()) {
119       return false;
120     }
121
122     ElementEntity that = (ElementEntity) o;
123
124     return id.equals(that.id);
125   }
126
127   public Id getElementHash() {
128     return elementHash;
129   }
130
131   public void setElementHash(Id elementHash) {
132     this.elementHash = elementHash;
133   }
134
135   @Override
136   public int hashCode() {
137     return id.hashCode();
138   }
139
140 }