Skip to content

Instantly share code, notes, and snippets.

@Zhuinden
Last active September 4, 2016 06:52
Show Gist options
  • Save Zhuinden/a34733ac559e9927c1d2c8032e0f75fe to your computer and use it in GitHub Desktop.
Save Zhuinden/a34733ac559e9927c1d2c8032e0f75fe to your computer and use it in GitHub Desktop.
Realm News Post Example Model
public class NewsPost extends RealmObject {
@PrimaryKey
@Required
private long id;
// left nullable as default as example
private String author;
private String title;
@Required
private String content;
@Index
@Required
private Date modified;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment