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 newFeedPageHeader
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
@NonNull HttpHeaders
extraHeaders()
Additional unstructured headers.int
hashCode()
@NonNull java.time.Instant
lastModified()
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.Self
self()
The stable URL of this page itself.@NonNull HttpHeaders
toHttpHeaders()
Return HTTP headers for this object.java.lang.String
toString()
-
-
-
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 newFeedPageHeader
instance.- 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:ToHttpHeaders
Return HTTP headers for this object.- Specified by:
toHttpHeaders
in 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-