Last active
September 4, 2016 06:52
-
-
Save Zhuinden/a34733ac559e9927c1d2c8032e0f75fe to your computer and use it in GitHub Desktop.
Realm News Post Example Model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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