Example #1
0
 @Override
 public int hashCode() {
   int hash = condition.hashCode();
   if (null != action) hash = hash * 23 + action.hashCode();
   if (null != meter) hash = hash * 23 + meter.hashCode();
   return hash;
 }
Example #2
0
 @Override
 public boolean equals(Object other) {
   if (this == other) return true;
   if (!(other instanceof Rule)) return false;
   Rule r = (Rule) other;
   if (!condition.equals(r.condition)) return false;
   if (meter == null && r.meter != null) return false;
   if (meter != null && !meter.equals(r.meter)) return false;
   if (null == action || null == r.action) {
     return action == r.action;
   } else {
     return action.equals(r.action);
   }
 }