@Test public void testEquals() { Model mo = new DefaultModel(); Node n = mo.newNode(); Overbook s = new Overbook(n, "foo", 3); Assert.assertTrue(s.equals(s)); Overbook o2 = new Overbook(n, "foo", 3); Assert.assertTrue(o2.equals(s)); Assert.assertEquals(o2.hashCode(), s.hashCode()); Assert.assertFalse(new Overbook(n, "bar", 3).equals(s)); Assert.assertFalse(new Overbook(n, "foo", 2).equals(s)); Assert.assertFalse(new Overbook(mo.newNode(), "foo", 3).equals(s)); Assert.assertNotEquals(new Overbook(mo.newNode(), "foo", 3, true), new Overbook(mo.newNode(), "foo", 3, false)); Assert.assertNotEquals(new Overbook(mo.newNode(), "foo", 3, true).hashCode(), new Overbook(mo.newNode(), "foo", 3, false).hashCode()); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Overbook overbook = (Overbook) o; return Double.compare(overbook.ratio, ratio) == 0 && isContinuous() == overbook.isContinuous() && Objects.equals(rcId, overbook.rcId) && Objects.equals(node, overbook.node); }
Overbook extends SimpleConstraint implements ResourceRelated { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Overbook overbook = (Overbook) o; return Double.compare(overbook.ratio, ratio) == 0 && isContinuous() == overbook.isContinuous() && Objects.equals(rcId, overbook.rcId) && Objects.equals(node, overbook.node); } }
Overbook extends SimpleConstraint implements ResourceRelated { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Overbook overbook = (Overbook) o; return Double.compare(overbook.ratio, ratio) == 0 && isContinuous() == overbook.isContinuous() && Objects.equals(rcId, overbook.rcId) && Objects.equals(node, overbook.node); } Overbook(Node n, String rc, double r);  Overbook(Node n, String rc, double r, boolean continuous); }
Overbook extends SimpleConstraint implements ResourceRelated { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Overbook overbook = (Overbook) o; return Double.compare(overbook.ratio, ratio) == 0 && isContinuous() == overbook.isContinuous() && Objects.equals(rcId, overbook.rcId) && Objects.equals(node, overbook.node); } Overbook(Node n, String rc, double r);  Overbook(Node n, String rc, double r, boolean continuous); static List<Overbook> newOverbooks(Collection<Node> nodes, String rc, double r); @Override String getResource(); double getRatio(); @Override String toString(); @Override Collection<Node> getInvolvedNodes(); @Override boolean equals(Object o); @Override int hashCode(); @Override SatConstraintChecker<Overbook> getChecker(); }
Overbook extends SimpleConstraint implements ResourceRelated { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Overbook overbook = (Overbook) o; return Double.compare(overbook.ratio, ratio) == 0 && isContinuous() == overbook.isContinuous() && Objects.equals(rcId, overbook.rcId) && Objects.equals(node, overbook.node); } Overbook(Node n, String rc, double r);  Overbook(Node n, String rc, double r, boolean continuous); static List<Overbook> newOverbooks(Collection<Node> nodes, String rc, double r); @Override String getResource(); double getRatio(); @Override String toString(); @Override Collection<Node> getInvolvedNodes(); @Override boolean equals(Object o); @Override int hashCode(); @Override SatConstraintChecker<Overbook> getChecker();  }