package org.zanata.webtrans.shared.model;

import java.io.Serializable;

import com.google.gwt.user.client.rpc.IsSerializable;

//@Immutable
public class DocumentId implements Identifier<Long>, Comparable,
        IsSerializable, Serializable {
    private static final long serialVersionUID = 1L;

    private Long id;

    private String docId;

    // for GWT
    @SuppressWarnings("unused")
    private DocumentId() {
    }

    public DocumentId(Long id, String docId) {
        this.id = id;
        this.docId = docId;
    }

    @Override
    public String toString() {
        return String.valueOf(id);
    }

    @Override
    public int hashCode() {
        return id.intValue();
    }

    @Override
    public Long getValue() {
        return id;
    }

    public Long getId() {
        return id;
    }

    public String getDocId() {
        return docId;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        return obj instanceof DocumentId && ((DocumentId) obj).id.equals(id);
    }

    @Override
    public int compareTo(Object o) {
        DocumentId compareTo = (DocumentId) o;
        return this.getDocId().compareTo(compareTo.getDocId());
    }
}

@@ -1184,24 +1184,182 @@
 Object o) %7B%0A
+        if (o == this) %7B%0A            return 0;%0A        %7D%0A        if (o == null) %7B%0A            return -1;%0A        %7D%0A        if (o instanceof DocumentId) %7B%0A    
         Docu
@@ -1393,16 +1393,20 @@
 tId) o;%0A
+    
         
@@ -1461,16 +1461,45 @@
 cId());%0A
+        %7D%0A        return -1;%0A
     %7D%0A%7D%0A

Fix up compareTo method