2 * Copyright (C) 2014 Cisco Systems, Inc.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 * Authors : Thomas Bachman
10 package org.opendaylight.groupbasedpolicy.renderer.opflex.lib.messages;
12 import java.util.List;
14 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
16 import com.fasterxml.jackson.databind.JsonNode;
17 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
18 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
22 public class ManagedObject {
24 public static class Property {
27 private JsonNode data;
29 public String getName() {
33 public void setName(String name) {
37 public JsonNode getData() {
41 public void setData(JsonNode data) {
46 public int hashCode() {
49 result = prime * result + ((data == null) ? 0 : data.hashCode());
50 result = prime * result + ((name == null) ? 0 : name.hashCode());
55 public boolean equals(Object obj) {
60 if (getClass() != obj.getClass())
62 Property other = (Property) obj;
64 if (other.data != null)
66 } else if (!data.asText().equals(other.getData().asText()))
69 if (other.name != null)
71 } else if (!name.equals(other.name))
78 private String subject;
80 private List<Property> properties;
81 private String parent_subject;
82 private Uri parent_uri;
83 private String parent_relation;
84 private List<Uri> children;
86 public String getSubject() {
90 public void setSubject(String subject) {
91 this.subject = subject;
98 public void setUri(Uri uri) {
102 public List<Property> getProperties() {
106 public void setProperties(List<Property> properties) {
107 this.properties = properties;
110 public String getParent_subject() {
111 return parent_subject;
114 public void setParent_subject(String parent_subject) {
115 this.parent_subject = parent_subject;
118 public Uri getParent_uri() {
122 public void setParent_uri(Uri parent_uri) {
123 this.parent_uri = parent_uri;
126 public String getParent_relation() {
127 return parent_relation;
130 public void setParent_relation(String parent_relation) {
131 this.parent_relation = parent_relation;
134 public List<Uri> getChildren() {
138 public void setChildren(List<Uri> children) {
139 this.children = children;
143 public int hashCode() {
144 final int prime = 31;
146 result = prime * result + ((children == null) ? 0 : children.hashCode());
147 result = prime * result + ((parent_relation == null) ? 0 : parent_relation.hashCode());
148 result = prime * result + ((parent_subject == null) ? 0 : parent_subject.hashCode());
149 result = prime * result + ((parent_uri == null) ? 0 : parent_uri.hashCode());
150 result = prime * result + ((properties == null) ? 0 : properties.hashCode());
151 result = prime * result + ((subject == null) ? 0 : subject.hashCode());
152 result = prime * result + ((uri == null) ? 0 : uri.hashCode());
157 public boolean equals(Object obj) {
162 if (getClass() != obj.getClass())
164 ManagedObject other = (ManagedObject) obj;
165 if (children == null) {
166 if (other.children != null)
168 } else if (!children.equals(other.children))
170 if (parent_relation == null) {
171 if (other.parent_relation != null)
173 } else if (!parent_relation.equals(other.parent_relation))
175 if (parent_subject == null) {
176 if (other.parent_subject != null)
178 } else if (!parent_subject.equals(other.parent_subject))
180 if (parent_uri == null) {
181 if (other.parent_uri != null)
183 } else if (!parent_uri.equals(other.parent_uri))
185 if (properties == null) {
186 if (other.properties != null)
188 } else if (!properties.equals(other.properties))
190 if (subject == null) {
191 if (other.subject != null)
193 } else if (!subject.equals(other.subject))
196 if (other.uri != null)
198 } else if (!uri.equals(other.uri))