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