code: private void writeObject(ObjectOutputStream out) throws IOException {
          PutField fields = out.putFields();
          fields.put(DOMAIN, domain);
          fields.put(ID, id);
          out.writeFields();
      }
docs: Serialize.
  
  @param out The stream to which this object is serialized.
  @throws IOException