/** * Ensures that serialization returns the unique instances. * * @return the object. * * @throws ObjectStreamException if there is a problem. */ private Object readResolve() throws ObjectStreamException { if (this.equals(Rotation.CLOCKWISE)) { return Rotation.CLOCKWISE; } else if (this.equals(Rotation.ANTICLOCKWISE)) { return Rotation.ANTICLOCKWISE; } return null; }
/** * Ensures that serialization returns the unique instances. * * @return the object. * * @throws ObjectStreamException if there is a problem. */ private Object readResolve() throws ObjectStreamException { if (this.equals(Rotation.CLOCKWISE)) { return Rotation.CLOCKWISE; } else if (this.equals(Rotation.ANTICLOCKWISE)) { return Rotation.ANTICLOCKWISE; } return null; }
/** * Ensures that serialization returns the unique instances. * * @return the object. * * @throws ObjectStreamException if there is a problem. */ private Object readResolve() throws ObjectStreamException { if (this.equals(Rotation.CLOCKWISE)) { return Rotation.CLOCKWISE; } else if (this.equals(Rotation.ANTICLOCKWISE)) { return Rotation.ANTICLOCKWISE; } return null; }
return false; if (!this.direction.equals(that.direction)) { return false;