When deserializing a RecipientType, we need to make sure to return only one of the known static final instances defined in this class. Subclasses must implement their own readResolve method that checks for their known instances before calling this super method. @return the RecipientTy
()
| 241 | * @exception ObjectStreamException for object stream errors |
| 242 | */ |
| 243 | protected Object readResolve() throws ObjectStreamException { |
| 244 | if (type.equals("To")) |
| 245 | return TO; |
| 246 | else if (type.equals("Cc")) |
| 247 | return CC; |
| 248 | else if (type.equals("Bcc")) |
| 249 | return BCC; |
| 250 | else |
| 251 | throw new InvalidObjectException( |
| 252 | "Attempt to resolve unknown RecipientType: " + type); |
| 253 | } |
| 254 | |
| 255 | @Override |
| 256 | public String toString() { |