Record Class RedditProperties

java.lang.Object
java.lang.Record
io.github.yvasyliev.telegramforwarderbot.configuration.RedditProperties
Record Components:
apiHost - Reddit API host URI
host - Reddit host URI
subreddit - Subreddit to monitor
username - Reddit username
userAgent - User agent string for Reddit API requests
videoDownloader - 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.
  • 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 a RedditProperties record class.
      Parameters:
      apiHost - the value for the apiHost record component
      host - the value for the host record component
      subreddit - the value for the subreddit record component
      username - the value for the username record component
      userAgent - the value for the userAgent record component
      videoDownloader - the value for the videoDownloader record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • apiHost

      @NotNull public @NotNull URI apiHost()
      Returns the value of the apiHost record component.
      Returns:
      the value of the apiHost record component
    • host

      @NotNull public @NotNull URI host()
      Returns the value of the host record component.
      Returns:
      the value of the host record component
    • subreddit

      @NotBlank public @NotBlank String subreddit()
      Returns the value of the subreddit record component.
      Returns:
      the value of the subreddit record component
    • username

      @NotBlank public @NotBlank String username()
      Returns the value of the username record component.
      Returns:
      the value of the username record component
    • userAgent

      @NotBlank public @NotBlank String userAgent()
      Returns the value of the userAgent record component.
      Returns:
      the value of the userAgent record component
    • videoDownloader

      @Validated @NotNull public @NotNull RedditProperties.VideoDownloader videoDownloader()
      Returns the value of the videoDownloader record component.
      Returns:
      the value of the videoDownloader record component