FeedItem extends FeedComponent implements ShownotesProvider, ImageResource, Serializable { public void updateFromOther(FeedItem other) { super.updateFromOther(other); if (other.imageUrl != null) { this.imageUrl = other.imageUrl; } if (other.title != null) { title = other.title; } if (other.getDescription() != null) { description = other.getDescription(); } if (other.getContentEncoded() != null) { contentEncoded = other.contentEncoded; } if (other.link != null) { link = other.link; } if (other.pubDate != null && !other.pubDate.equals(pubDate)) { pubDate = other.pubDate; } if (other.media != null) { if (media == null) { setMedia(other.media); setNew(); } else if (media.compareWithOther(other.media)) { media.updateFromOther(other.media); } } if (other.paymentLink != null) { paymentLink = other.paymentLink; } if (other.chapters != null) { if (!hasChapters) { chapters = other.chapters; } } } FeedItem();  FeedItem(long id, String title, String link, Date pubDate, String paymentLink, long feedId,
                    boolean hasChapters, String imageUrl, int state,
                    String itemIdentifier, long autoDownload);  FeedItem(long id, String title, String itemIdentifier, String link, Date pubDate, int state, Feed feed);  FeedItem(long id, String title, String itemIdentifier, String link, Date pubDate, int state, Feed feed, boolean hasChapters); static FeedItem fromCursor(Cursor cursor); void updateFromOther(FeedItem other); String getIdentifyingValue(); String getTitle(); void setTitle(String title); String getDescription(); void setDescription(String description); String getLink(); void setLink(String link); Date getPubDate(); void setPubDate(Date pubDate); @Nullable FeedMedia getMedia(); void setMedia(FeedMedia media); Feed getFeed(); void setFeed(Feed feed); boolean isNew(); void setNew(); boolean isPlayed(); void setPlayed(boolean played); String getContentEncoded(); void setContentEncoded(String contentEncoded); String getPaymentLink(); void setPaymentLink(String paymentLink); List<Chapter> getChapters(); void setChapters(List<Chapter> chapters); String getItemIdentifier(); void setItemIdentifier(String itemIdentifier); boolean hasMedia(); @Override Callable<String> loadShownotes(); @Override String getImageLocation(); State getState(); long getFeedId(); void setFeedId(long feedId); String getImageUrl(); void setImageUrl(String imageUrl); @Override String getHumanReadableIdentifier(); boolean hasChapters(); void setAutoDownload(boolean autoDownload); boolean getAutoDownload(); int getFailedAutoDownloadAttempts(); boolean isAutoDownloadable(); boolean isTagged(String tag); void addTag(String tag); void removeTag(String tag); @NonNull @Override String toString(); static final String TAG_QUEUE; static final String TAG_FAVORITE; static final int NEW; static final int UNPLAYED; static final int PLAYED; }
@Test public void testUpdateFromOther_feedItemImageDownloadUrlChanged() throws Exception { setNewFeedItemImageDownloadUrl(); original.updateFromOther(changedFeedItem); assertFeedItemImageWasUpdated(); }
@Test public void testUpdateFromOther_feedItemImageRemoved() throws Exception { feedItemImageRemoved(); original.updateFromOther(changedFeedItem); assertFeedItemImageWasNotUpdated(); }