@ScannerSide @ServerSide @ComputeEngineSide public class Durations extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Durations.DurationFormat
Deprecated.
since 6.3, only one format is available
|
Constructor and Description |
---|
Durations() |
Modifier and Type | Method and Description |
---|---|
Duration |
create(long minutes)
Create a Duration object from a number of minutes
|
Duration |
decode(String duration)
Convert the text to a Duration
Example : decode("9d 10 h") -> Duration.encode("10d2h") |
String |
encode(Duration duration)
Return the string value of the Duration.
|
String |
format(Duration duration)
Return the formatted work duration using the english bundles.
|
String |
format(Locale locale,
Duration duration)
Deprecated.
since 6.3 as the
Locale.ENGLISH is always used. Use format(Duration) instead |
String |
format(Locale locale,
Duration duration,
Durations.DurationFormat format)
Deprecated.
since 6.3 as the
Locale.ENGLISH is always used. Use format(Duration) instead |
public Durations()
public Duration decode(String duration)
IllegalArgumentException
public String encode(Duration duration)
@Deprecated public String format(Locale locale, Duration duration, Durations.DurationFormat format)
Locale.ENGLISH
is always used. Use format(Duration)
instead@Deprecated public String format(Locale locale, Duration duration)
Locale.ENGLISH
is always used. Use format(Duration)
insteadCopyright © 2009–2018 SonarSource. All rights reserved.