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 {
26 private JsonNode data;
27 public String getName() {
30 public void setName(String name) {
33 public JsonNode getData() {
36 public void setData(JsonNode data) {
40 public int hashCode() {
43 result = prime * result + ((data == null) ? 0 : data.hashCode());
44 result = prime * result + ((name == null) ? 0 : name.hashCode());
48 public boolean equals(Object obj) {
53 if (getClass() != obj.getClass())
55 Property other = (Property) obj;
57 if (other.data != null)
59 } else if (!data.asText().equals(other.getData().asText()))
62 if (other.name != null)
64 } else if (!name.equals(other.name))
71 private String subject;
73 private List<Property> properties;
74 private String parent_subject;
75 private Uri parent_uri;
76 private String parent_relation;
77 private List<Uri> children;
79 public String getSubject() {
82 public void setSubject(String subject) {
83 this.subject = subject;
88 public void setUri(Uri uri) {
91 public List<Property> getProperties() {
94 public void setProperties(List<Property> properties) {
95 this.properties = properties;
97 public String getParent_subject() {
98 return parent_subject;
100 public void setParent_subject(String parent_subject) {
101 this.parent_subject = parent_subject;
103 public Uri getParent_uri() {
106 public void setParent_uri(Uri parent_uri) {
107 this.parent_uri = parent_uri;
109 public String getParent_relation() {
110 return parent_relation;
112 public void setParent_relation(String parent_relation) {
113 this.parent_relation = parent_relation;
115 public List<Uri> getChildren() {
118 public void setChildren(List<Uri> children) {
119 this.children = children;
123 public int hashCode() {
124 final int prime = 31;
126 result = prime * result
127 + ((children == null) ? 0 : children.hashCode());
128 result = prime * result
129 + ((parent_relation == null) ? 0 : parent_relation.hashCode());
130 result = prime * result
131 + ((parent_subject == null) ? 0 : parent_subject.hashCode());
132 result = prime * result
133 + ((parent_uri == null) ? 0 : parent_uri.hashCode());
134 result = prime * result
135 + ((properties == null) ? 0 : properties.hashCode());
136 result = prime * result + ((subject == null) ? 0 : subject.hashCode());
137 result = prime * result + ((uri == null) ? 0 : uri.hashCode());
142 public boolean equals(Object obj) {
147 if (getClass() != obj.getClass())
149 ManagedObject other = (ManagedObject) obj;
150 if (children == null) {
151 if (other.children != null)
153 } else if (!children.equals(other.children))
155 if (parent_relation == null) {
156 if (other.parent_relation != null)
158 } else if (!parent_relation.equals(other.parent_relation))
160 if (parent_subject == null) {
161 if (other.parent_subject != null)
163 } else if (!parent_subject.equals(other.parent_subject))
165 if (parent_uri == null) {
166 if (other.parent_uri != null)
168 } else if (!parent_uri.equals(other.parent_uri))
170 if (properties == null) {
171 if (other.properties != null)
173 } else if (!properties.equals(other.properties))
175 if (subject == null) {
176 if (other.subject != null)
178 } else if (!subject.equals(other.subject))
181 if (other.uri != null)
183 } else if (!uri.equals(other.uri))