- java.lang.Object
-
- com.apptasticsoftware.rssreader.Item
-
- All Implemented Interfaces:
java.lang.Comparable<Item>
public class Item extends java.lang.Object implements java.lang.Comparable<Item>
Class representing a RSS item. A channel may contain any number of items. An item may represent a "story" -- much like a story in a newspaper or magazine; if so its description is a synopsis of the story, and the link points to the full story.
-
-
Constructor Summary
Constructors Constructor Description Item()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Item o)Compares publication time of twoItemobjects.booleanequals(java.lang.Object o)java.util.Optional<java.lang.String>getAuthor()Get email address of the author of the item.java.util.Optional<java.lang.String>getCategory()Get category for item.ChannelgetChannel()Get the channel that this item was published in.java.util.Optional<java.lang.String>getDescription()Get the item synopsis.java.util.Optional<Enclosure>getEnclosure()Get the enclosure of the item.java.util.Optional<java.lang.String>getGuid()Get a string that uniquely identifies the item.java.util.Optional<java.lang.Boolean>getIsPermaLink()If the guid element has an attribute named "isPermaLink" with a value of true, the reader may assume that it is a permalink to the item, that is, a url that can be opened in a Web browser, that points to the full item described by the item element.java.util.Optional<java.lang.String>getLink()Get the URL of the item.java.util.Optional<java.lang.String>getPubDate()Get a string that indicates when the item was published.java.util.Optional<java.time.ZonedDateTime>getPubDateZonedDateTime()Get a ZonedDateTime that indicates when the item was published.java.util.Optional<java.lang.String>getTitle()Get the title of the item.inthashCode()voidsetAuthor(java.lang.String author)Set email address of the author of the item.voidsetCategory(java.lang.String category)Set category for item.voidsetChannel(Channel channel)Set the channel that this item was published in.voidsetDescription(java.lang.String description)Set the item synopsis.voidsetEnclosure(Enclosure enclosure)Set the enclosure of the item.voidsetGuid(java.lang.String guid)Set a string that uniquely identifies the item.voidsetIsPermaLink(boolean isPermaLink)If the guid element has an attribute named "isPermaLink" with a value of true, the reader may assume that it is a permalink to the item, that is, a url that can be opened in a Web browser, that points to the full item described by the item element.voidsetLink(java.lang.String link)Set the URL of the item.voidsetPubDate(java.lang.String pubDate)Set a string that indicates when the item was published.voidsetTitle(java.lang.String title)Set the title of the item.
-
-
-
Method Detail
-
getEnclosure
public java.util.Optional<Enclosure> getEnclosure()
Get the enclosure of the item.- Returns:
- enclosure
-
setEnclosure
public void setEnclosure(Enclosure enclosure)
Set the enclosure of the item.- Parameters:
enclosure- enclosure
-
getTitle
public java.util.Optional<java.lang.String> getTitle()
Get the title of the item.- Returns:
- title
-
setTitle
public void setTitle(java.lang.String title)
Set the title of the item.- Parameters:
title- title
-
getDescription
public java.util.Optional<java.lang.String> getDescription()
Get the item synopsis.- Returns:
- description
-
setDescription
public void setDescription(java.lang.String description)
Set the item synopsis.- Parameters:
description- description
-
getLink
public java.util.Optional<java.lang.String> getLink()
Get the URL of the item.- Returns:
- link
-
setLink
public void setLink(java.lang.String link)
Set the URL of the item.- Parameters:
link- link
-
getAuthor
public java.util.Optional<java.lang.String> getAuthor()
Get email address of the author of the item.- Returns:
- author
-
setAuthor
public void setAuthor(java.lang.String author)
Set email address of the author of the item.- Parameters:
author- author
-
getCategory
public java.util.Optional<java.lang.String> getCategory()
Get category for item.- Returns:
- category
-
setCategory
public void setCategory(java.lang.String category)
Set category for item.- Parameters:
category- category
-
getGuid
public java.util.Optional<java.lang.String> getGuid()
Get a string that uniquely identifies the item.- Returns:
- guid
-
setGuid
public void setGuid(java.lang.String guid)
Set a string that uniquely identifies the item.- Parameters:
guid- guid
-
getIsPermaLink
public java.util.Optional<java.lang.Boolean> getIsPermaLink()
If the guid element has an attribute named "isPermaLink" with a value of true, the reader may assume that it is a permalink to the item, that is, a url that can be opened in a Web browser, that points to the full item described by the item element.- Returns:
- permanent link
-
setIsPermaLink
public void setIsPermaLink(boolean isPermaLink)
If the guid element has an attribute named "isPermaLink" with a value of true, the reader may assume that it is a permalink to the item, that is, a url that can be opened in a Web browser, that points to the full item described by the item element.- Parameters:
isPermaLink- is perma link
-
getPubDate
public java.util.Optional<java.lang.String> getPubDate()
Get a string that indicates when the item was published.- Returns:
- publication date
-
setPubDate
public void setPubDate(java.lang.String pubDate)
Set a string that indicates when the item was published.- Parameters:
pubDate- publication date
-
getPubDateZonedDateTime
public java.util.Optional<java.time.ZonedDateTime> getPubDateZonedDateTime()
Get a ZonedDateTime that indicates when the item was published.- Returns:
- publication date
-
getChannel
public Channel getChannel()
Get the channel that this item was published in.- Returns:
- channel
-
setChannel
public void setChannel(Channel channel)
Set the channel that this item was published in.- Parameters:
channel- channel
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-