From 94d5284a472fa2ca9c0d8415dea96f4143645558 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Thu, 12 May 2016 22:31:39 +0200 Subject: [PATCH] remove unused class RulePriorityBean --- .../org/easyrules/core/RulePriorityBean.java | 58 ------------------- 1 file changed, 58 deletions(-) delete mode 100644 easyrules-core/src/main/java/org/easyrules/core/RulePriorityBean.java diff --git a/easyrules-core/src/main/java/org/easyrules/core/RulePriorityBean.java b/easyrules-core/src/main/java/org/easyrules/core/RulePriorityBean.java deleted file mode 100644 index 868cf9f..0000000 --- a/easyrules-core/src/main/java/org/easyrules/core/RulePriorityBean.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.easyrules.core; - -/** - * Utility class that associates a rule to its priority. - * - * @author Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com) - */ -final class RulePriorityBean implements Comparable { - - private int priority; - - private Object rule; - - private RulePriorityBean(final int priority, final Object rule) { - this.priority = priority; - this.rule = rule; - } - - public int getPriority() { - return priority; - } - - public Object getRule() { - return rule; - } - - @Override - public int compareTo(final RulePriorityBean ruleBean) { - if (priority < ruleBean.getPriority()) { - return -1; - } else if (priority > ruleBean.getPriority()) { - return 1; - } else { - return rule.equals(ruleBean.getRule()) ? 0 : 1; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof RulePriorityBean)) return false; - - RulePriorityBean ruleBean = (RulePriorityBean) o; - - if (priority != ruleBean.priority) return false; - if (!rule.equals(ruleBean.rule)) return false; - - return true; - } - - @Override - public int hashCode() { - int result = priority; - result = 31 * result + rule.hashCode(); - return result; - } - -}