forked from Together-Java/TJ-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRSSFeedsConfig.java
More file actions
38 lines (34 loc) · 1.78 KB
/
RSSFeedsConfig.java
File metadata and controls
38 lines (34 loc) · 1.78 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.Map;
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.
* @param clientRequestHeaders The headers that will be sent with each request to the RSS feeds.
*/
public record RSSFeedsConfig(@JsonProperty(value = "feeds", required = true) List<RSSFeed> feeds,
@JsonProperty(value = "fallbackChannelPattern",
required = true) String fallbackChannelPattern,
@JsonProperty(value = "pollIntervalInMinutes", required = true) int pollIntervalInMinutes,
@JsonProperty(value = "clientRequestHeaders") Map<String, String> clientRequestHeaders) {
/**
* 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 pollIntervalInMinutes The interval (in minutes) for polling the RSS feeds for updates.
* @param clientRequestHeaders The headers that will be sent with each request to the RSS feeds.
* @throws NullPointerException if any of the parameters (feeds or fallbackChannelPattern) are
* null
*/
public RSSFeedsConfig {
Objects.requireNonNull(feeds);
Objects.requireNonNull(fallbackChannelPattern);
}
}