Package org.gitlab4j.api.utils
Class DurationUtils
java.lang.Object
org.gitlab4j.api.utils.DurationUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final int
Parses a human readable duration string and calculates the number of seconds it represents.static final String
toString
(int durationSeconds) Create a human readable duration string from seconds.static final String
toString
(int durationSeconds, boolean includeMonths) Create a human readable duration string from seconds.
-
Constructor Details
-
DurationUtils
public DurationUtils()
-
-
Method Details
-
toString
Create a human readable duration string from seconds.- Parameters:
durationSeconds
- the total number of seconds in the duration- Returns:
- a human readable string representing the duration
-
toString
Create a human readable duration string from seconds.- Parameters:
durationSeconds
- the total number of seconds in the durationincludeMonths
- when true will include months "mo", in the string otherwise uses "4w" for each month- Returns:
- a human readable string representing the duration
-
parse
Parses a human readable duration string and calculates the number of seconds it represents.- Parameters:
durationString
- the human readable duration- Returns:
- the total number of seconds in the duration
-