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 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final WebhookServerConfigDefault instance of WebhookServerConfig with standard configurations:hostis set tonull, localhostportis set to 8443useHttpsis set tofalse(HTTP is used by default)keystorePathandkeystorePasswordare not set -
Constructor Summary
ConstructorsConstructorDescriptionWebhookServerConfig(@Nullable String host, int port, @Nullable Path keystorePath, @Nullable String keystorePassword, boolean useHttps) Creates an instance of aWebhookServerConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable Stringhost()Returns the value of thehostrecord component.@Nullable StringReturns the value of thekeystorePasswordrecord component.@Nullable PathReturns the value of thekeystorePathrecord component.intport()Returns the value of theportrecord component.final StringtoString()Returns a string representation of this record class.booleanuseHttps()Returns the value of theuseHttpsrecord component.
-
Field Details
-
DEFAULT
Default instance of WebhookServerConfig with standard configurations:hostis set tonull, localhostportis set to 8443useHttpsis set tofalse(HTTP is used by default)keystorePathandkeystorePasswordare 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 aWebhookServerConfigrecord class.- Parameters:
host- the value for thehostrecord componentport- the value for theportrecord componentkeystorePath- the value for thekeystorePathrecord componentkeystorePassword- the value for thekeystorePasswordrecord componentuseHttps- the value for theuseHttpsrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
host
Returns the value of thehostrecord component.- Returns:
- the value of the
hostrecord component
-
port
public int port()Returns the value of theportrecord component.- Returns:
- the value of the
portrecord component
-
keystorePath
Returns the value of thekeystorePathrecord component.- Returns:
- the value of the
keystorePathrecord component
-
keystorePassword
Returns the value of thekeystorePasswordrecord component.- Returns:
- the value of the
keystorePasswordrecord component
-
useHttps
public boolean useHttps()Returns the value of theuseHttpsrecord component.- Returns:
- the value of the
useHttpsrecord component
-