@Test public void testEquals() { Margins eq1 = new Margins(0, 1, 10, 9); Margins eq2 = new Margins(0, 1, 10, 9); Margins eq3 = new Margins(0, 1, 10, 9); Margins diff = new Margins(1, 1, 10, 9); TestUtils.testEqualsAndHashCodes(eq1, eq2, eq3, diff); }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Margins)) { return false; } Margins instance = (Margins) other; return new EqualsBuilder().append(top, instance.top).append(right, instance.right) .append(bottom, instance.bottom).append(left, instance.left).isEquals(); }
Margins { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Margins)) { return false; } Margins instance = (Margins) other; return new EqualsBuilder().append(top, instance.top).append(right, instance.right) .append(bottom, instance.bottom).append(left, instance.left).isEquals(); } }
Margins { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Margins)) { return false; } Margins instance = (Margins) other; return new EqualsBuilder().append(top, instance.top).append(right, instance.right) .append(bottom, instance.bottom).append(left, instance.left).isEquals(); } Margins(double top, double right, double bottom, double left); }
Margins { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Margins)) { return false; } Margins instance = (Margins) other; return new EqualsBuilder().append(top, instance.top).append(right, instance.right) .append(bottom, instance.bottom).append(left, instance.left).isEquals(); } Margins(double top, double right, double bottom, double left); static double inchesToPoints(double inches); static double pointsToInches(double points); Margins rotate(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other); }
Margins { @Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Margins)) { return false; } Margins instance = (Margins) other; return new EqualsBuilder().append(top, instance.top).append(right, instance.right) .append(bottom, instance.bottom).append(left, instance.left).isEquals(); } Margins(double top, double right, double bottom, double left); static double inchesToPoints(double inches); static double pointsToInches(double points); Margins rotate(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other); @NotNegative
    final double top; @NotNegative
    final double right; @NotNegative
    final double bottom; @NotNegative
    final double left; }