*/
package uk.ac.vamsas.client;
+import java.io.Serializable;
+
/**
* The unique reference id for a Vamsas document Vobject,
* used by applications to refer to the vamsas Vobject
* within their own data space in the vamsas document.
- * TODO: decide if VorbaId should contain a reference
- * to either the IVorbaIdFactory that made it or the
- * IClient that defines the session (it might be
- * convenient).
+ * This is serializable (thanks to Dominik Lindner) so an
+ * application can store it easily.
* @author jimp
*/
-public class VorbaId {
+public class VorbaId implements Serializable {
+ /**
+ * 1 is first vamsas release ID version.
+ */
+ private static final long serialVersionUID = 1L;
protected String id;
protected VorbaId() {
super();
return vobject.vorbaId;
}
}
+ /**
+ * protected VorbaId constructor used when turning XML ID strings into vorba IDs
+ * @param id
+ * @return VorbaId object or null if string was null.
+ */
protected static VorbaId newId(String id) {
- return new VorbaId(id);
+ return (id==null) ? null : new VorbaId(id);
}
/**
* @return Returns the id.