Record Class RedditProperties
java.lang.Object
java.lang.Record
io.github.yvasyliev.telegramforwarderbot.configuration.RedditProperties
- Record Components:
apiHost- Reddit API host URIhost- Reddit host URIsubreddit- Subreddit to monitorusername- Reddit usernameuserAgent- User agent string for Reddit API requestsvideoDownloader- Configuration for downloading videos from Reddit
@ConfigurationProperties(prefix="reddit")
@Validated
public record RedditProperties(@NotNull URI apiHost, @NotNull URI host, @NotBlank String subreddit, @NotBlank String username, @NotBlank String userAgent, @NotNull RedditProperties.VideoDownloader videoDownloader)
extends Record
Configuration properties for Reddit integration.
This class holds the necessary properties to connect to Reddit's API,
including the API host, subreddit, username, user agent,
and video downloader configuration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordConfiguration for downloading videos from Reddit. -
Constructor Summary
ConstructorsConstructorDescriptionRedditProperties(@NotNull URI apiHost, @NotNull URI host, @NotBlank String subreddit, @NotBlank String username, @NotBlank String userAgent, @NotNull RedditProperties.VideoDownloader videoDownloader) Creates an instance of aRedditPropertiesrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull URIapiHost()Returns the value of theapiHostrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull URIhost()Returns the value of thehostrecord component.@NotBlank StringReturns the value of thesubredditrecord component.final StringtoString()Returns a string representation of this record class.@NotBlank StringReturns the value of theuserAgentrecord component.@NotBlank Stringusername()Returns the value of theusernamerecord component.@NotNull RedditProperties.VideoDownloaderReturns the value of thevideoDownloaderrecord component.
-
Constructor Details
-
RedditProperties
public RedditProperties(@NotNull @NotNull URI apiHost, @NotNull @NotNull URI host, @NotBlank @NotBlank String subreddit, @NotBlank @NotBlank String username, @NotBlank @NotBlank String userAgent, @Validated @NotNull @NotNull RedditProperties.VideoDownloader videoDownloader) Creates an instance of aRedditPropertiesrecord class.- Parameters:
apiHost- the value for theapiHostrecord componenthost- the value for thehostrecord componentsubreddit- the value for thesubredditrecord componentusername- the value for theusernamerecord componentuserAgent- the value for theuserAgentrecord componentvideoDownloader- the value for thevideoDownloaderrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
apiHost
Returns the value of theapiHostrecord component.- Returns:
- the value of the
apiHostrecord component
-
host
Returns the value of thehostrecord component.- Returns:
- the value of the
hostrecord component
-
subreddit
Returns the value of thesubredditrecord component.- Returns:
- the value of the
subredditrecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
userAgent
Returns the value of theuserAgentrecord component.- Returns:
- the value of the
userAgentrecord component
-
videoDownloader
Returns the value of thevideoDownloaderrecord component.- Returns:
- the value of the
videoDownloaderrecord component
-