Record Class BootstrapConfiguration
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.bootstrap.BootstrapConfiguration
- Record Components:
mode- mode of operationtokenFilePath- token file path (required forBootstrapMode.PERSISTENT_FILE)tokenValidity- how long a generated token stays valid before it is regenerated on startup and rejected by the service
public record BootstrapConfiguration(BootstrapMode mode, Path tokenFilePath, Duration tokenValidity)
extends Record
Bootstrap configuration record.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBootstrapConfiguration(BootstrapMode mode, Path tokenFilePath, Duration tokenValidity) Creates an instance of aBootstrapConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic BootstrapConfigurationdisabled()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.mode()Returns the value of themoderecord component.static BootstrapConfigurationpersistent(Path tokenFilePath) static BootstrapConfigurationpersistent(Path tokenFilePath, Duration tokenValidity) Returns the value of thetokenFilePathrecord component.Returns the value of thetokenValidityrecord component.final StringtoString()Returns a string representation of this record class.static BootstrapConfigurationstatic BootstrapConfigurationtransientConsole(Duration tokenValidity)
-
Field Details
-
DEFAULT_VALIDITY
Default token lifetime — 24 hours.
-
-
Constructor Details
-
BootstrapConfiguration
Creates an instance of aBootstrapConfigurationrecord class.- Parameters:
mode- the value for themoderecord componenttokenFilePath- the value for thetokenFilePathrecord componenttokenValidity- the value for thetokenValidityrecord component
-
-
Method Details
-
disabled
-
persistent
-
persistent
-
transientConsole
-
transientConsole
-
toString
-
hashCode
-
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). -
mode
-
tokenFilePath
Returns the value of thetokenFilePathrecord component.- Returns:
- the value of the
tokenFilePathrecord component
-
tokenValidity
Returns the value of thetokenValidityrecord component.- Returns:
- the value of the
tokenValidityrecord component
-