package org.ccci.gto.android.common.jsonapi.model;

import org.ccci.gto.android.common.jsonapi.annotation.JsonApiId;

public abstract class ModelBase {
    @JsonApiId
    public int mId;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        final ModelBase modelBase = (ModelBase) o;

        return mId == modelBase.mId;
    }

    @Override
    public int hashCode() {
        return mId;
    }
}

@@ -45,16 +45,61 @@
 model;%0A%0A
+import android.support.annotation.Nullable;%0A%0A
 import o
@@ -190,16 +190,30 @@
 lBase %7B%0A
+    @Nullable%0A
     @Jso
@@ -230,19 +230,23 @@
  public 
-i
+I
 nt
+eger
  mId;%0A%0A 
@@ -523,24 +523,67 @@
 mId 
-== modelBase.mId
+!= null ? mId.equals(modelBase.mId) : modelBase.mId == null
 ;%0A  
@@ -647,16 +647,50 @@
 turn mId
+ != null ? mId : Integer.MAX_VALUE
 ;%0A    %7D%0A

make it possible to have a null id for models