FeedEntry

One entry of a feed. Stable Core. Built with FeedEntry(id) { title = …; link = … }, by RomeFeedParser and by a parser of your own.

What every entry guarantees (the factory enforces it, whichever parser built the entry):

  • id is never blank.

  • link, when present, is a canonical absolute http or https link with its fragment kept. Url is not used: it drops fragments and refuses non-ASCII hosts.

  • every enclosure has a canonical absolute URL and a FeedEnclosure.lengthBytes that is null or positive.

Whichever parser built the entry, treat summary and content as untrusted markup (HTML, XHTML or text, the format does not say) and sanitise them before rendering.

As RomeFeedParser builds it (a parser of your own guarantees only the invariants above):

  • id is the guid or Atom id, else the entry's link as written, else a digest webtools-feeds:v1:<32 hex digits> of its title, summary or content, enclosure URL and published date. The rule is frozen: an id you stored stays the same for the same entry across releases, and does not change when the feed moves host or protocol. An entry with nothing to hash has the constant digest of nothing, so several can share an id.

  • publishedAtEpochMillis and updatedAtEpochMillis are null when absent, unparseable or outside the years 1 to 9999.

  • categories hold no exact duplicates; enclosures hold no two with the same URL.

Never use the dates to decide whether an entry is new: use id. Equality is on every field. toString() prints counts and presence, never text, and links as scheme, host and port.

Types

Link copied to clipboard

Collects the optional fields of a FeedEntry. Not thread-safe; use it only inside the factory's lambda.

Properties

Link copied to clipboard

The author, or null.

Link copied to clipboard

The categories, in document order.

Link copied to clipboard

The content: untrusted markup, or null.

Link copied to clipboard

The enclosures, in document order.

Link copied to clipboard
val id: String

The entry's identity; never blank.

Link copied to clipboard
val link: String?

An absolute http or https link, fragment kept, or null.

Link copied to clipboard

When the entry was published, in epoch milliseconds, or null.

Link copied to clipboard

The summary: untrusted markup, or null.

Link copied to clipboard

The title, or null.

Link copied to clipboard

When the entry was last updated, in epoch milliseconds, or null.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int

Returns a hash code consistent with equals: it is computed from the same properties.

Link copied to clipboard
open override fun toString(): String

A diagnostic string for logs: the length of id, the link as scheme, host and port, the numbers of categories and enclosures, and whether each other optional field is present, never any text. Its format is not part of the API and may change.