[SDC-29] Amdocs OnBoard 1707 initial commit.
[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 Info info;
34   private Collection<Relation> relations = Collections.emptyList();
35   private ByteBuffer data;
36   private ByteBuffer searchableData;
37   private ByteBuffer visualization;
38   private Set<Id> subElementIds = Collections.emptySet();
39
40   public ElementEntity(Id id) {
41     this.id = id;
42   }
43
44   public Id getParentId() {
45     return parentId;
46   }
47
48   public void setParentId(Id parentId) {
49     this.parentId = parentId;
50   }
51
52   public Id getId() {
53     return id;
54   }
55
56   public void setId(Id id) {
57     this.id = id;
58   }
59
60   public Namespace getNamespace() {
61     return namespace;
62   }
63
64   public void setNamespace(Namespace namespace) {
65     this.namespace = namespace;
66   }
67
68   public Info getInfo() {
69     return info;
70   }
71
72   public void setInfo(Info info) {
73     this.info = info;
74   }
75
76   public Collection<Relation> getRelations() {
77     return relations;
78   }
79
80   public void setRelations(Collection<Relation> relations) {
81     this.relations = relations;
82   }
83
84   public ByteBuffer getData() {
85     return data;
86   }
87
88   public void setData(ByteBuffer data) {
89     this.data = data;
90   }
91
92   public ByteBuffer getSearchableData() {
93     return searchableData;
94   }
95
96   public void setSearchableData(ByteBuffer searchableData) {
97     this.searchableData = searchableData;
98   }
99
100   public ByteBuffer getVisualization() {
101     return visualization;
102   }
103
104   public void setVisualization(ByteBuffer visualization) {
105     this.visualization = visualization;
106   }
107
108   public Set<Id> getSubElementIds() {
109     return subElementIds;
110   }
111
112   public void setSubElementIds(Set<Id> subElementIds) {
113     this.subElementIds = subElementIds;
114   }
115
116   @Override
117   public boolean equals(Object o) {
118     if (this == o) {
119       return true;
120     }
121     if (o == null || getClass() != o.getClass()) {
122       return false;
123     }
124
125     ElementEntity that = (ElementEntity) o;
126
127     return id.equals(that.id);
128   }
129
130   @Override
131   public int hashCode() {
132     return id.hashCode();
133   }
134 }