WooDroid/app/src/main/java/me/gilo/wc/models/Model.java
2019-04-02 05:50:21 +03:00

38 lines
701 B
Java

package me.gilo.wc.models;
import android.support.annotation.NonNull;
import com.google.firebase.firestore.IgnoreExtraProperties;
import com.google.firebase.firestore.ServerTimestamp;
import java.io.Serializable;
import java.util.Date;
/**
* A Base Model to be extended by other models to add ids.
*/
@IgnoreExtraProperties
public class Model implements Serializable {
public String id;
@ServerTimestamp
private Date date_created = null;
public <T extends Model> T withId(@NonNull final String id) {
this.id = id;
return (T) this;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}