@Test public void fillFromIntent() { Intent intent = new Intent(); intent.putExtra("_id", 1L); intent.putExtra("alias", "alias"); intent.putExtra("url", "http: intent.putExtra("title", "test title"); intent.putExtra("description", "test description"); intent.putExtra("image", "image url"); intent.putExtra("content", "<p>test paragraph</p>"); intent.putExtra("author", "jake klinker"); intent.putExtra("source", "google.com"); intent.putExtra("domain", "google.com"); intent.putExtra("duration", 1); intent.putExtra("inserted_at", 2L); intent.putExtra("is_article", true); intent.putExtra("saved", false); Article article = new Article(intent); assertEquals(1L, article.id); assertEquals("alias", article.alias); assertEquals("http: assertEquals("test title", article.title); assertEquals("test description", article.description); assertEquals("image url", article.image); assertEquals("<p>test paragraph</p>", article.content); assertEquals("jake klinker", article.author); assertEquals("google.com", article.source); assertEquals("google.com", article.domain); assertEquals(1, article.duration); assertEquals(2, article.insertedAt); assertTrue(article.isArticle); assertFalse(article.saved); }
public void fillFromIntent(Intent intent) { Bundle extras = intent.getExtras(); this.id = extras.getLong(ArticleModel.COLUMN_ID); this.alias = extras.getString(ArticleModel.COLUMN_ALIAS); this.url = extras.getString(ArticleModel.COLUMN_URL); this.title = extras.getString(ArticleModel.COLUMN_TITLE); this.description = extras.getString(ArticleModel.COLUMN_DESCRIPTION); this.image = extras.getString(ArticleModel.COLUMN_IMAGE); this.content = extras.getString(ContentModel.COLUMN_CONTENT); this.author = extras.getString(ArticleModel.COLUMN_AUTHOR); this.source = extras.getString(ArticleModel.COLUMN_SOURCE); this.domain = extras.getString(ArticleModel.COLUMN_DOMAIN); this.duration = extras.getInt(ArticleModel.COLUMN_DURATION); this.insertedAt = extras.getLong(ArticleModel.COLUMN_INSERTED_AT); this.isArticle = extras.getBoolean(ArticleModel.COLUMN_IS_ARTICLE); this.saved = extras.getBoolean(ArticleModel.COLUMN_SAVED); }
Article implements DatabaseModel { public void fillFromIntent(Intent intent) { Bundle extras = intent.getExtras(); this.id = extras.getLong(ArticleModel.COLUMN_ID); this.alias = extras.getString(ArticleModel.COLUMN_ALIAS); this.url = extras.getString(ArticleModel.COLUMN_URL); this.title = extras.getString(ArticleModel.COLUMN_TITLE); this.description = extras.getString(ArticleModel.COLUMN_DESCRIPTION); this.image = extras.getString(ArticleModel.COLUMN_IMAGE); this.content = extras.getString(ContentModel.COLUMN_CONTENT); this.author = extras.getString(ArticleModel.COLUMN_AUTHOR); this.source = extras.getString(ArticleModel.COLUMN_SOURCE); this.domain = extras.getString(ArticleModel.COLUMN_DOMAIN); this.duration = extras.getInt(ArticleModel.COLUMN_DURATION); this.insertedAt = extras.getLong(ArticleModel.COLUMN_INSERTED_AT); this.isArticle = extras.getBoolean(ArticleModel.COLUMN_IS_ARTICLE); this.saved = extras.getBoolean(ArticleModel.COLUMN_SAVED); } }
Article implements DatabaseModel { public void fillFromIntent(Intent intent) { Bundle extras = intent.getExtras(); this.id = extras.getLong(ArticleModel.COLUMN_ID); this.alias = extras.getString(ArticleModel.COLUMN_ALIAS); this.url = extras.getString(ArticleModel.COLUMN_URL); this.title = extras.getString(ArticleModel.COLUMN_TITLE); this.description = extras.getString(ArticleModel.COLUMN_DESCRIPTION); this.image = extras.getString(ArticleModel.COLUMN_IMAGE); this.content = extras.getString(ContentModel.COLUMN_CONTENT); this.author = extras.getString(ArticleModel.COLUMN_AUTHOR); this.source = extras.getString(ArticleModel.COLUMN_SOURCE); this.domain = extras.getString(ArticleModel.COLUMN_DOMAIN); this.duration = extras.getInt(ArticleModel.COLUMN_DURATION); this.insertedAt = extras.getLong(ArticleModel.COLUMN_INSERTED_AT); this.isArticle = extras.getBoolean(ArticleModel.COLUMN_IS_ARTICLE); this.saved = extras.getBoolean(ArticleModel.COLUMN_SAVED); } Article();  Article(Cursor cursor);  Article(Intent intent); }
Article implements DatabaseModel { public void fillFromIntent(Intent intent) { Bundle extras = intent.getExtras(); this.id = extras.getLong(ArticleModel.COLUMN_ID); this.alias = extras.getString(ArticleModel.COLUMN_ALIAS); this.url = extras.getString(ArticleModel.COLUMN_URL); this.title = extras.getString(ArticleModel.COLUMN_TITLE); this.description = extras.getString(ArticleModel.COLUMN_DESCRIPTION); this.image = extras.getString(ArticleModel.COLUMN_IMAGE); this.content = extras.getString(ContentModel.COLUMN_CONTENT); this.author = extras.getString(ArticleModel.COLUMN_AUTHOR); this.source = extras.getString(ArticleModel.COLUMN_SOURCE); this.domain = extras.getString(ArticleModel.COLUMN_DOMAIN); this.duration = extras.getInt(ArticleModel.COLUMN_DURATION); this.insertedAt = extras.getLong(ArticleModel.COLUMN_INSERTED_AT); this.isArticle = extras.getBoolean(ArticleModel.COLUMN_IS_ARTICLE); this.saved = extras.getBoolean(ArticleModel.COLUMN_SAVED); } Article();  Article(Cursor cursor);  Article(Intent intent); @Override void fillFromCursor(Cursor cursor); void fillFromIntent(Intent intent); void putIntoIntent(Intent intent); }
Article implements DatabaseModel { public void fillFromIntent(Intent intent) { Bundle extras = intent.getExtras(); this.id = extras.getLong(ArticleModel.COLUMN_ID); this.alias = extras.getString(ArticleModel.COLUMN_ALIAS); this.url = extras.getString(ArticleModel.COLUMN_URL); this.title = extras.getString(ArticleModel.COLUMN_TITLE); this.description = extras.getString(ArticleModel.COLUMN_DESCRIPTION); this.image = extras.getString(ArticleModel.COLUMN_IMAGE); this.content = extras.getString(ContentModel.COLUMN_CONTENT); this.author = extras.getString(ArticleModel.COLUMN_AUTHOR); this.source = extras.getString(ArticleModel.COLUMN_SOURCE); this.domain = extras.getString(ArticleModel.COLUMN_DOMAIN); this.duration = extras.getInt(ArticleModel.COLUMN_DURATION); this.insertedAt = extras.getLong(ArticleModel.COLUMN_INSERTED_AT); this.isArticle = extras.getBoolean(ArticleModel.COLUMN_IS_ARTICLE); this.saved = extras.getBoolean(ArticleModel.COLUMN_SAVED); } Article();  Article(Cursor cursor);  Article(Intent intent); @Override void fillFromCursor(Cursor cursor); void fillFromIntent(Intent intent); void putIntoIntent(Intent intent); public long id; public String alias; public String url; public String title; public String description; public String image; public String content; public String author; public String source; public String domain; public int duration; public long insertedAt; public boolean isArticle; public boolean saved; public Long sourceId; public String sourceModelName; public String sourceModelImageUrl; }