Package io.datareplication.model.feed
Class FeedPageHeader
- java.lang.Object
-
- io.datareplication.model.feed.FeedPageHeader
-
- All Implemented Interfaces:
ToHttpHeaders
public final class FeedPageHeader extends java.lang.Object implements ToHttpHeaders
This class represents the headers of a snapshot page.
-
-
Constructor Summary
Constructors Constructor Description FeedPageHeader(@NonNull java.time.Instant lastModified, Link.Self self, @NonNull java.util.Optional<@NonNull Link.Prev> prev, @NonNull java.util.Optional<@NonNull Link.Next> next)FeedPageHeader(@NonNull java.time.Instant lastModified, Link.Self self, @NonNull java.util.Optional<@NonNull Link.Prev> prev, @NonNull java.util.Optional<@NonNull Link.Next> next, @NonNull HttpHeaders extraHeaders)Creates a newFeedPageHeaderinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)@NonNull HttpHeadersextraHeaders()Additional unstructured headers.inthashCode()@NonNull java.time.InstantlastModified()The page's timestamp.@NonNull java.util.Optional<@NonNull Link.Next>next()The URL of the immediately next (i.e.@NonNull java.util.Optional<@NonNull Link.Prev>prev()The URL of the immediately previous (i.e.Link.Selfself()The stable URL of this page itself.@NonNull HttpHeaderstoHttpHeaders()Return HTTP headers for this object.java.lang.StringtoString()
-
-
-
Constructor Detail
-
FeedPageHeader
public FeedPageHeader(@NonNull @NonNull java.time.Instant lastModified, @NonNull Link.Self self, @NonNull @NonNull java.util.Optional<@NonNull Link.Prev> prev, @NonNull @NonNull java.util.Optional<@NonNull Link.Next> next)
-
FeedPageHeader
public FeedPageHeader(@NonNull @NonNull java.time.Instant lastModified, @NonNull Link.Self self, @NonNull @NonNull java.util.Optional<@NonNull Link.Prev> prev, @NonNull @NonNull java.util.Optional<@NonNull Link.Next> next, @NonNull @NonNull HttpHeaders extraHeaders)Creates a newFeedPageHeaderinstance.- Parameters:
lastModified- The page's timestamp. This is equal to the timestamp of the page's final entity.self- The stable URL of this page itself. This URL must always resolve to this page, even as new entities are added to the feed.prev- The URL of the immediately previous (i.e. older) feed page. If this header is missing then there are no older pages and this page marks the start of the feed.next- The URL of the immediately next (i.e. newer) feed page. If this header is missing then there are no newer pages and this is currently the latest page of the feed.extraHeaders- Additional unstructured headers.
-
-
Method Detail
-
toHttpHeaders
@NonNull public @NonNull HttpHeaders toHttpHeaders()
Description copied from interface:ToHttpHeadersReturn HTTP headers for this object.- Specified by:
toHttpHeadersin interfaceToHttpHeaders- Returns:
- HTTP headers associated with this object
-
lastModified
@NonNull public @NonNull java.time.Instant lastModified()
The page's timestamp. This is equal to the timestamp of the page's final entity.
-
self
@NonNull public Link.Self self()
The stable URL of this page itself. This URL must always resolve to this page, even as new entities are added to the feed.
-
prev
@NonNull public @NonNull java.util.Optional<@NonNull Link.Prev> prev()
The URL of the immediately previous (i.e. older) feed page. If this header is missing then there are no older pages and this page marks the start of the feed.
-
next
@NonNull public @NonNull java.util.Optional<@NonNull Link.Next> next()
The URL of the immediately next (i.e. newer) feed page. If this header is missing then there are no newer pages and this is currently the latest page of the feed.
-
extraHeaders
@NonNull public @NonNull HttpHeaders extraHeaders()
Additional unstructured headers.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-