Record Class WebhookServerConfig

java.lang.Object
java.lang.Record
org.teleight.teleightbots.webhook.WebhookServerConfig
Record Components:
port - The port on which the webhook server will listen for incoming requests.
keystorePath - The path to the SSL/TLS keystore file used for secure connections (HTTPS).
keystorePassword - The password for the keystore, used to access the SSL certificates.
useHttps - Whether the server should use HTTPS for secure communication.

public record WebhookServerConfig(@Nullable String host, int port, @Nullable Path keystorePath, @Nullable String keystorePassword, boolean useHttps) extends Record
Settings for configuring an internal webhook server.

Example usage:


 WebhookServerConfig config = WebhookServerConfig.ofBuilder()
           .port(8443)
           .keystorePath(Paths.get("/path/to/keystore"))
           .keystorePassword("securePassword")
           .useHttps(true)
           .build();
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final WebhookServerConfig
    Default instance of WebhookServerConfig with standard configurations: host is set to null, localhost port is set to 8443 useHttps is set to false (HTTP is used by default) keystorePath and keystorePassword are not set
  • Constructor Summary

    Constructors
    Constructor
    Description
    WebhookServerConfig(@Nullable String host, int port, @Nullable Path keystorePath, @Nullable String keystorePassword, boolean useHttps)
    Creates an instance of a WebhookServerConfig record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @Nullable String
    Returns the value of the host record component.
    @Nullable String
    Returns the value of the keystorePassword record component.
    @Nullable Path
    Returns the value of the keystorePath record component.
    int
    Returns the value of the port record component.
    final String
    Returns a string representation of this record class.
    boolean
    Returns the value of the useHttps record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT

      public static final WebhookServerConfig DEFAULT
      Default instance of WebhookServerConfig with standard configurations:
      • host is set to null, localhost
      • port is set to 8443
      • useHttps is set to false (HTTP is used by default)
      • keystorePath and keystorePassword are not set
  • Constructor Details

    • WebhookServerConfig

      public WebhookServerConfig(@Nullable @Nullable String host, int port, @Nullable @Nullable Path keystorePath, @Nullable @Nullable String keystorePassword, boolean useHttps)
      Creates an instance of a WebhookServerConfig record class.
      Parameters:
      host - the value for the host record component
      port - the value for the port record component
      keystorePath - the value for the keystorePath record component
      keystorePassword - the value for the keystorePassword record component
      useHttps - the value for the useHttps 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • host

      @Nullable public @Nullable String host()
      Returns the value of the host record component.
      Returns:
      the value of the host record component
    • port

      public int port()
      Returns the value of the port record component.
      Returns:
      the value of the port record component
    • keystorePath

      @Nullable public @Nullable Path keystorePath()
      Returns the value of the keystorePath record component.
      Returns:
      the value of the keystorePath record component
    • keystorePassword

      @Nullable public @Nullable String keystorePassword()
      Returns the value of the keystorePassword record component.
      Returns:
      the value of the keystorePassword record component
    • useHttps

      public boolean useHttps()
      Returns the value of the useHttps record component.
      Returns:
      the value of the useHttps record component