Skip to content

Instantly share code, notes, and snippets.

@mplacona
Created August 10, 2016 17:04
Show Gist options
  • Save mplacona/d7ab036d1fbda5d57536326c7eff2cf1 to your computer and use it in GitHub Desktop.
Save mplacona/d7ab036d1fbda5d57536326c7eff2cf1 to your computer and use it in GitHub Desktop.
import java.util.Calendar;
import java.util.Date;
import java.util.UUID;
import io.realm.RealmModel;
import io.realm.annotations.PrimaryKey;
import io.realm.annotations.RealmClass;
@RealmClass
public class Note implements RealmModel {
@PrimaryKey
private String id = UUID.randomUUID().toString();;
private String text;
private Date date = new Date(java.text.DateFormat.getDateTimeInstance().format(Calendar.getInstance().getTime()));
public Note(){ }
public Note(String text) { this.text = text; }
public void setText(String text) { this.text = text; }
public String getText() { return text;}
public void setId(String id) { this.id = id; }
public String getId() { return id; }
public Date getDate() { return date; }
public void setDate(Date date) { this.date = date; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment