Package io.micronaut.rss.jsonfeed
Class JsonFeed
java.lang.Object
io.micronaut.rss.jsonfeed.JsonFeed
A JSON Feed is a list that may change over time, and the individual items in the list may change..
- Since:
- 2.2.0
- Author:
- Sergio del Amo, mark1626
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAuthor
(@NonNull JsonFeedAuthor author) void
void
addItem
(@NonNull JsonFeedItem item) static @NonNull JsonFeed.Builder
builder()
static @NonNull JsonFeed.Builder
builder
(@NonNull String version, @NonNull String title, @NonNull List<JsonFeedItem> items) static @NonNull JsonFeed.Builder
builder
(@NonNull String title, @NonNull List<JsonFeedItem> items) Creates builder with required fields.List<@Valid JsonFeedAuthor>
Specifies one or more feed authors.Detail on what the feed is about.@Nullable Boolean
Says whether or not the feed is finished — that is, whether or not it will ever update again.@Nullable String
The URL of an image for the feed suitable to be used in a source list.@Nullable String
The URL of the feed, and serves as the unique identifier for the feed.@Nullable String
The URL of the resource that the feed describes.getHubs()
Describes endpoints that can be used to subscribe to real-time notifications from the publisher of this feed.@Nullable String
getIcon()
The URL of an image for the feed suitable to be used in a timeline, much the way an avatar might be used.@NonNull List<JsonFeedItem>
getItems()
The items in the field.@Nullable String
The primary language for the feed in the format specified in RFC 5646.@Nullable String
The URL of a feed that provides the next n items, where n is determined by the publisher.@NonNull String
getTitle()
The name of the feed, which will often correspond to the name of the website.@Nullable String
Description of the purpose of the feed.@NonNull String
Returns the URL of the version of the format the feed uses.void
setAuthors
(@Nullable List<@Valid JsonFeedAuthor> authors) Specifies one or more feed authors.void
setDescription
(String description) Detail on what the feed is about.void
setExpired
(@Nullable Boolean expired) Says whether or not the feed is finished — that is, whether or not it will ever update again.void
setFavicon
(@Nullable String favicon) The URL of an image for the feed suitable to be used in a source list.void
setFeedUrl
(@Nullable String feedUrl) The URL of the feed, and serves as the unique identifier for the feed.void
setHomePageUrl
(@Nullable String homePageUrl) The URL of the resource that the feed describes.void
Describes endpoints that can be used to subscribe to real-time notifications from the publisher of this feed.void
The URL of an image for the feed suitable to be used in a timeline, much the way an avatar might be used.void
setItems
(@NonNull List<JsonFeedItem> items) The items in the field.void
setLanguage
(@Nullable String language) The primary language for the feed in the format specified in RFC 5646.void
setNextURL
(@Nullable String nextURL) The URL of a feed that provides the next n items, where n is determined by the publisher.void
The name of the feed, which will often correspond to the name of the website.void
setUserComment
(@Nullable String userComment) Description of the purpose of the feed.void
setVersion
(@NonNull String version) URL of the version of the format the feed uses.toMap()
-
Field Details
-
VERSION_JSON_FEED_1
- See Also:
-
VERSION_JSON_FEED_1_1
- See Also:
-
KEY_VERSION
- See Also:
-
KEY_TITLE
- See Also:
-
KEY_HOME_PAGE_URL
- See Also:
-
KEY_FEED_URL
- See Also:
-
KEY_DESCRIPTION
- See Also:
-
KEY_USER_COMMENT
- See Also:
-
KEY_NEXT_URL
- See Also:
-
KEY_ICON
- See Also:
-
KEY_FAVICON
- See Also:
-
KEY_AUTHORS
- See Also:
-
KEY_ITEMS
- See Also:
-
KEY_AUTHOR
- See Also:
-
KEY_LANGUAGE
- See Also:
-
KEY_EXPIRED
- See Also:
-
KEY_HUBS
- See Also:
-
-
Constructor Details
-
JsonFeed
public JsonFeed()
-
-
Method Details
-
builder
- Returns:
- JSON Feed Builder
-
builder
@NonNull public static @NonNull JsonFeed.Builder builder(@NonNull @NonNull String title, @NonNull @NonNull List<JsonFeedItem> items) Creates builder with required fields.- Parameters:
title
- JSON Feed's titleitems
- JSON Feed's items- Returns:
- JSON Feed Builder
-
builder
@NonNull public static @NonNull JsonFeed.Builder builder(@NonNull @NonNull String version, @NonNull @NonNull String title, @NonNull @NonNull List<JsonFeedItem> items) - Parameters:
version
- JSON Feed versiontitle
- JSON Feed's titleitems
- JSON Feed's items- Returns:
- JSON Feed Builder
-
setVersion
URL of the version of the format the feed uses.- Parameters:
version
- of JSON feed
-
getVersion
Returns the URL of the version of the format the feed uses.- Returns:
- version of JSON feed
-
getTitle
The name of the feed, which will often correspond to the name of the website.- Returns:
- the name of the feed
-
setTitle
The name of the feed, which will often correspond to the name of the website.- Parameters:
title
- the name of the feed
-
getHomePageUrl
The URL of the resource that the feed describes. This resource may or may not actually be a “home” page, but it should be an HTML page- Returns:
- The URL of the resource that the feed describes
-
setHomePageUrl
The URL of the resource that the feed describes. This resource may or may not actually be a “home” page, but it should be an HTML page- Parameters:
homePageUrl
- The URL of the resource that the feed describes
-
getDescription
Detail on what the feed is about. A feed reader may display this text.- Returns:
- detail on what the feed is about
-
setDescription
Detail on what the feed is about. A feed reader may display this text.- Parameters:
description
- detail on what the feed is about
-
getFeedUrl
The URL of the feed, and serves as the unique identifier for the feed.- Returns:
- the URL of the feed, and serves as the unique identifier for the feed
-
setFeedUrl
The URL of the feed, and serves as the unique identifier for the feed.- Parameters:
feedUrl
- the URL of the feed, and serves as the unique identifier for the feed
-
getUserComment
Description of the purpose of the feed. This is for the use of people looking at the raw JSON, and should be ignored by feed readers- Returns:
- description of the purpose of the feed.
-
setUserComment
Description of the purpose of the feed. This is for the use of people looking at the raw JSON, and should be ignored by feed readers- Parameters:
userComment
- description of the purpose of the feed.
-
getNextURL
The URL of a feed that provides the next n items, where n is determined by the publisher. This allows for pagination, but with the expectation that reader software is not required to use it and probably won’t use it very often- Returns:
- the URL of a feed that provides the next n items
-
setNextURL
The URL of a feed that provides the next n items, where n is determined by the publisher. This allows for pagination, but with the expectation that reader software is not required to use it and probably won’t use it very often- Parameters:
nextURL
- the URL of a feed that provides the next n items
-
getIcon
The URL of an image for the feed suitable to be used in a timeline, much the way an avatar might be used. It should be square and relatively large — such as 512 x 512 pixels- Returns:
- the URL of an image for the feed suitable to be used in a timeline
-
setIcon
The URL of an image for the feed suitable to be used in a timeline, much the way an avatar might be used. It should be square and relatively large — such as 512 x 512 pixels- Parameters:
icon
- the URL of an image for the feed suitable to be used in a timeline
-
getFavicon
The URL of an image for the feed suitable to be used in a source list. It should be square and relatively small, but not smaller than 64 x 64 pixels- Returns:
- the URL of an image for the feed suitable to be used in a source list
-
setFavicon
The URL of an image for the feed suitable to be used in a source list. It should be square and relatively small, but not smaller than 64 x 64 pixels- Parameters:
favicon
- the URL of an image for the feed suitable to be used in a source list
-
getAuthors
Specifies one or more feed authors. The author object has several members- Returns:
- specifies one or more feed authors
-
setAuthors
Specifies one or more feed authors. The author object has several members- Parameters:
authors
- specifies one or more feed authors
-
getLanguage
The primary language for the feed in the format specified in RFC 5646.- Returns:
- the primary language for the feed
-
setLanguage
The primary language for the feed in the format specified in RFC 5646.- Parameters:
language
- the primary language for the feed
-
getExpired
Says whether or not the feed is finished — that is, whether or not it will ever update again.- Returns:
- expired says whether or not the feed is finished
-
setExpired
Says whether or not the feed is finished — that is, whether or not it will ever update again.- Parameters:
expired
- says whether or not the feed is finished
-
getHubs
Describes endpoints that can be used to subscribe to real-time notifications from the publisher of this feed.- Returns:
- Describes endpoints that can be used to subscribe to real-time notifications
-
setHubs
Describes endpoints that can be used to subscribe to real-time notifications from the publisher of this feed.- Parameters:
hubs
- Describes endpoints that can be used to subscribe to real-time notifications
-
addHub
- Parameters:
hub
- Endpoint that can be used to subscribe to real-time notifications from the publisher of this feed.
-
getItems
The items in the field.- Returns:
- list of items in the feed
-
setItems
The items in the field.- Parameters:
items
- list of items in the feed
-
addAuthor
- Parameters:
author
- Global JSON Feed's author
-
addItem
- Parameters:
item
- JSON Feed's item
-
toMap
- Returns:
- Map representation of Object.
-