FeedValidators

class FeedValidators(etag: String?, lastModified: String?)(source)

The conditional-GET validators of a feed: the ETag and the Last-Modified of its last response, held verbatim. Stable Core. Store what FeedFetch.validators returns after every response and hand it back to FeedFetcher.fetch on the next poll. A value loaded from your storage is held to the same rules as one read from a response: SP and HTAB are trimmed at both ends; an empty value is null; the ETag has at most 256 and the Last-Modified at most 64 characters; every character is U+0020 to U+007E (the request type refuses anything else, so a stored non-ASCII tag would fail every later fetch); an ETag is never *. A value that breaks a rule becomes null, never truncated, and a Last-Modified is never parsed or reformatted. Equality is on both values; toString() prints whether each is present, never a value.

Parameters

etag

the entity tag as the server sent it, quotes and W/ included, or null.

lastModified

the Last-Modified date as the server sent it, or null.

Constructors

Link copied to clipboard
constructor(etag: String?, lastModified: String?)

Types

Link copied to clipboard
object Companion

The constant.

Properties

Link copied to clipboard
val etag: String?

The entity tag, verbatim, or null.

Link copied to clipboard

The Last-Modified date, verbatim, or null.

Functions

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

Two FeedValidators are equal when their etag and lastModified are equal.

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: whether etag and lastModified are present, never a value. Its format is not part of the API and may change.