]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.document.server/src/org/simantics/document/server/handler/AbstractResponseHandler.java
cf20ca670f444e0a28dbaa48df83e1ea7bbf987e
[simantics/platform.git] / bundles / org.simantics.document.server / src / org / simantics / document / server / handler / AbstractResponseHandler.java
1 package org.simantics.document.server.handler;
2
3 public abstract class AbstractResponseHandler extends AbstractEventHandler {
4
5         private String expression;
6         
7         public AbstractResponseHandler(String expression) {
8                 this.expression = expression;
9         }
10
11         @Override
12         public int hashCode() {
13                 final int prime = 31;
14                 int result = 1;
15                 result = prime * result + ((expression == null) ? 0 : expression.hashCode());
16                 return result;
17         }
18
19         @Override
20         public boolean equals(Object obj) {
21                 if (this == obj)
22                         return true;
23                 if (obj == null)
24                         return false;
25                 if (getClass() != obj.getClass())
26                         return false;
27                 AbstractResponseHandler other = (AbstractResponseHandler) obj;
28                 if (expression == null) {
29                         if (other.expression != null)
30                                 return false;
31                 } else if (!expression.equals(other.expression))
32                         return false;
33                 return true;
34         }
35         
36 }