-
-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathRSSFeedsConfig.java
More file actions
38 lines (34 loc) · 1.75 KB
/
RSSFeedsConfig.java
File metadata and controls
38 lines (34 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package org.togetherjava.tjbot.config;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Objects;
/**
* Represents the configuration for an RSS feed, which includes the list of feeds to subscribe to, a
* pattern for identifying Java news channels, and the interval (in minutes) for polling the feeds.
*
* @param feeds The list of RSS feeds to subscribe to.
* @param fallbackChannelPattern The pattern used to identify the fallback text channel to use.
* @param pollIntervalInMinutes The interval (in minutes) for polling the RSS feeds for updates.
*/
public record RSSFeedsConfig(@JsonProperty(value = "feeds", required = true) List<RSSFeed> feeds,
@JsonProperty(value = "fallbackChannelPattern",
required = true) String fallbackChannelPattern,
@JsonProperty(value = "videoLinkPattern", required = true) String videoLinkPattern,
@JsonProperty(value = "pollIntervalInMinutes", required = true) int pollIntervalInMinutes) {
/**
* Constructs a new {@link RSSFeedsConfig}.
*
* @param feeds The list of RSS feeds to subscribe to.
* @param fallbackChannelPattern The pattern used to identify the fallback text channel to use.
* @param videoLinkPattern pattern determining if a link is a video. It is then posted in a way
* to support Discord video embeds.
* @param pollIntervalInMinutes The interval (in minutes) for polling the RSS feeds for updates.
* @throws NullPointerException if any of the parameters (feeds or fallbackChannelPattern) are
* null
*/
public RSSFeedsConfig {
Objects.requireNonNull(feeds);
Objects.requireNonNull(fallbackChannelPattern);
Objects.requireNonNull(videoLinkPattern);
}
}