java.lang.Object
net.i2p.router.news.NewsEntry
All Implemented Interfaces:
Comparable<NewsEntry>

public class NewsEntryextends Object implements Comparable<NewsEntry>
Represents a single news entry with content and metadata.

Encapsulates news item data including title, link, identifier, update timestamp, summary, content, and author information. Supports content type specification and proper sorting based on update timestamps.

Provides Comparable interface implementation for chronological ordering of news entries. All String fields may be null to accommodate optional metadata elements in news feeds.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Display name of the item's author, a subnode of the author node.
    Body text of the item, in the markup named by contentType.
    Markup language of the content field, as an attribute of it.
    Feed-assigned identifier for the item.
    URL the headline links to.
    Short synopsis shown in the headline list.
    Headline text of the news item.
    long
    Publication time in milliseconds since the epoch.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Every field is left at its default - null Strings and a zero update timestamp - for the Atom parser to fill in as it reads the entry.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    int
    Newest first.
    boolean
    Treats two entries as equal when they share an update time.
    int
    Hash by the updated timestamp.

    Methods inherited from class Object

    clone, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • title

      public String title
      Headline text of the news item.
    • id

      public String id
      Feed-assigned identifier for the item.
    • updated

      public long updated
      Publication time in milliseconds since the epoch.
    • summary

      public String summary
      Short synopsis shown in the headline list.
    • content

      public String content
      Body text of the item, in the markup named by contentType.
    • contentType

      public String contentType
      Markup language of the content field, as an attribute of it.
    • authorName

      public String authorName
      Display name of the item's author, a subnode of the author node.
  • Constructor Details

    • NewsEntry

      public NewsEntry()
      Every field is left at its default - null Strings and a zero update timestamp - for the Atom parser to fill in as it reads the entry.
  • Method Details

    • compareTo

      public int compareTo(NewsEntry e)
      Newest first.
      Specified by:
      compareTo in interface Comparable<NewsEntry>
    • equals

      public boolean equals(Object o)
      Treats two entries as equal when they share an update time.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Hash by the updated timestamp.
      Overrides:
      hashCode in class Object
      Returns:
      whether h code is present