Class DurationParser
java.lang.Object
org.springframework.vault.support.DurationParser
Utility to parse a Go format duration into
Duration.- Since:
- 2.3
- Author:
- Mark Paluch
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatDuration(Duration duration) Format aDurationinto the Go format representation.static @Nullable DurationparseDuration(@Nullable String duration) Parse a Go format duration into aDurationobject.
-
Constructor Details
-
DurationParser
public DurationParser()
-
-
Method Details
-
parseDuration
Parse a Go format duration into aDurationobject.- Parameters:
duration- the duration string to parse in Go's duration format.- Returns:
- the duration object. Can be null if
durationis empty. - Throws:
IllegalArgumentException- if unable to parse the requested duration.
-
formatDuration
Format aDurationinto the Go format representation.- Parameters:
duration- the duration object to format.- Returns:
- the duration formatted in Go's duration format.
-