/** * 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(UnitType.ABSOLUTE)) { return UnitType.ABSOLUTE; } else if (this.equals(UnitType.RELATIVE)) { return UnitType.RELATIVE; } 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(UnitType.ABSOLUTE)) { return UnitType.ABSOLUTE; } else if (this.equals(UnitType.RELATIVE)) { return UnitType.RELATIVE; } 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(UnitType.ABSOLUTE)) { return UnitType.ABSOLUTE; } else if (this.equals(UnitType.RELATIVE)) { return UnitType.RELATIVE; } return null; }