Class DurationParser
java.lang.Object
org.springframework.vault.support.DurationParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatDuration
(Duration duration) Format aDuration
into the Go format representation.static @Nullable Duration
parseDuration
(@Nullable String duration) Parse a Go format duration into aDuration
object.
-
Constructor Details
-
DurationParser
public DurationParser()
-
-
Method Details
-
parseDuration
Parse a Go format duration into aDuration
object.- Parameters:
duration
- the duration string to parse in Go's duration format.- Returns:
- the duration object. Can be null if
duration
is empty. - Throws:
IllegalArgumentException
- if unable to parse the requested duration.
-
formatDuration
-