Package tech.lastbox.jwt
Enum Class ExpirationTimeUnit
- All Implemented Interfaces:
Serializable,Comparable<ExpirationTimeUnit>,Constable
Enum representing various time units for expiration (Days, Hours, Minutes, Seconds).
This enum is used to define the unit of time that will be used for token expiration.
Each constant corresponds to a specific
ChronoUnit.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionReturns theChronoUnitassociated with this expiration time unit.toDuration(long amount) Converts the given amount of time to aDurationusing this expiration time unit.static ExpirationTimeUnitReturns the enum constant of this class with the specified name.static ExpirationTimeUnit[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DAYS
Represents the time unit in days. -
HOURS
Represents the time unit in hours. -
MINUTES
Represents the time unit in minutes. -
SECONDS
Represents the time unit in seconds.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getChronoUnit
Returns theChronoUnitassociated with this expiration time unit.- Returns:
- the corresponding
ChronoUnit.
-
toDuration
Converts the given amount of time to aDurationusing this expiration time unit.- Parameters:
amount- the amount of time.- Returns:
- a
Durationrepresenting the specified amount of time.
-