]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/SVGNodeAssignment.java
Support for dynamic transforms for both elements and terminals
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / g2d / nodes / SVGNodeAssignment.java
1 package org.simantics.scenegraph.g2d.nodes;
2
3 /**
4  * @author Antti Villberg
5  * @since 1.29.0
6  */
7 public class SVGNodeAssignment {
8         public String elementId;
9         public String attributeNameOrId;
10         public String value;
11         public SVGNodeAssignment(String elementId, String attributeNameOrId, String value) {
12                 this.elementId = elementId;
13                 this.attributeNameOrId = attributeNameOrId;
14                 this.value = value;
15         }
16         @Override
17         public int hashCode() {
18                 final int prime = 31;
19                 int result = 1;
20                 result = prime * result + ((attributeNameOrId == null) ? 0 : attributeNameOrId.hashCode());
21                 result = prime * result + ((elementId == null) ? 0 : elementId.hashCode());
22                 result = prime * result + ((value == null) ? 0 : value.hashCode());
23                 return result;
24         }
25         @Override
26         public boolean equals(Object obj) {
27                 if (this == obj)
28                         return true;
29                 if (obj == null)
30                         return false;
31                 if (getClass() != obj.getClass())
32                         return false;
33                 SVGNodeAssignment other = (SVGNodeAssignment) obj;
34                 if (attributeNameOrId == null) {
35                         if (other.attributeNameOrId != null)
36                                 return false;
37                 } else if (!attributeNameOrId.equals(other.attributeNameOrId))
38                         return false;
39                 if (elementId == null) {
40                         if (other.elementId != null)
41                                 return false;
42                 } else if (!elementId.equals(other.elementId))
43                         return false;
44                 if (value == null) {
45                         if (other.value != null)
46                                 return false;
47                 } else if (!value.equals(other.value))
48                         return false;
49                 return true;
50         }
51 }