Class 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
      int compareTo​(Item o)
      Compares publication time of two Item objects.
      boolean equals​(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.
      Channel getChannel()
      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.
      int hashCode()  
      void setAuthor​(java.lang.String author)
      Set email address of the author of the item.
      void setCategory​(java.lang.String category)
      Set category for item.
      void setChannel​(Channel channel)
      Set the channel that this item was published in.
      void setDescription​(java.lang.String description)
      Set the item synopsis.
      void setEnclosure​(Enclosure enclosure)
      Set the enclosure of the item.
      void setGuid​(java.lang.String guid)
      Set a string that uniquely identifies the item.
      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.
      void setLink​(java.lang.String link)
      Set the URL of the item.
      void setPubDate​(java.lang.String pubDate)
      Set a string that indicates when the item was published.
      void setTitle​(java.lang.String title)
      Set the title of the item.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Item

        public 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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

        public int compareTo​(Item o)
        Compares publication time of two Item objects.
        Specified by:
        compareTo in interface java.lang.Comparable<Item>
        Parameters:
        o - item to compare
        Returns:
        value
        Since:
        2.2.0