/** * Tests the equality of this object against an arbitrary Object. * <P> * This method will return true ONLY if the object is an Hour object * representing the same hour as this instance. * * @param obj the object to compare (<code>null</code> permitted). * * @return <code>true</code> if the hour and day value of the object * is the same as this. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Hour)) { return false; } Hour that = (Hour) obj; if (this.hour != that.hour) { return false; } if (!this.day.equals(that.day)) { return false; } return true; }
/** * Tests the equality of this object against an arbitrary Object. * <P> * This method will return true ONLY if the object is an Hour object * representing the same hour as this instance. * * @param obj the object to compare ({@code null} permitted). * * @return {@code true} if the hour and day value of the object * is the same as this. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Hour)) { return false; } Hour that = (Hour) obj; if (this.hour != that.hour) { return false; } if (!this.day.equals(that.day)) { return false; } return true; }
return false; if (!this.day.equals(that.day)) { return false;
return false; if (!this.day.equals(that.day)) { return false;
return false; if (!this.day.equals(that.day)) { return false;
return false; if (!this.day.equals(that.day)) { return false;