2 * Copyright © 2016-2017 European Support Limited
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.openecomp.core.zusammen.plugin.dao.types;
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;
24 import java.nio.ByteBuffer;
25 import java.util.Collection;
26 import java.util.Collections;
29 public class ElementEntity {
32 private Namespace namespace;
33 private Id elementHash;
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();
41 public ElementEntity(Id id) {
49 public Id getParentId() {
53 public void setParentId(Id parentId) {
54 this.parentId = parentId;
57 public Namespace getNamespace() {
61 public void setNamespace(Namespace namespace) {
62 this.namespace = namespace;
65 public Info getInfo() {
69 public void setInfo(Info info) {
73 public Collection<Relation> getRelations() {
77 public void setRelations(Collection<Relation> relations) {
78 this.relations = relations;
81 public ByteBuffer getData() {
85 public void setData(ByteBuffer data) {
89 public ByteBuffer getSearchableData() {
90 return searchableData;
93 public void setSearchableData(ByteBuffer searchableData) {
94 this.searchableData = searchableData;
97 public ByteBuffer getVisualization() {
101 public void setVisualization(ByteBuffer visualization) {
102 this.visualization = visualization;
105 public Set<Id> getSubElementIds() {
106 return subElementIds;
109 public void setSubElementIds(Set<Id> subElementIds) {
110 this.subElementIds = subElementIds;
114 public boolean equals(Object o) {
118 if (o == null || getClass() != o.getClass()) {
122 ElementEntity that = (ElementEntity) o;
124 return id.equals(that.id);
127 public Id getElementHash() {
131 public void setElementHash(Id elementHash) {
132 this.elementHash = elementHash;
136 public int hashCode() {
137 return id.hashCode();