Class DurationUnitConverter
- java.lang.Object
-
- com.fasterxml.jackson.datatype.threetenbp.util.DurationUnitConverter
-
public class DurationUnitConverter extends Object
Handles the conversion of the duration based on the API ofDurationfor a restricted set ofChronoUnit. Only the units considered as accurate are supported in this converter since are the only ones capable of handling deserialization in a precise manner (seeChronoUnit.isDurationEstimated()).- Since:
- 2.12
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDurationUnitConverter.DurationSerialization
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.threeten.bp.Durationconvert(long value)longconvert(org.threeten.bp.Duration duration)static StringdescForAllowed()static DurationUnitConverterfrom(String unit)
-
-
-
Method Detail
-
convert
public org.threeten.bp.Duration convert(long value)
-
convert
public long convert(org.threeten.bp.Duration duration)
-
descForAllowed
public static String descForAllowed()
- Returns:
- Description of all allowed valued as a sequence of double-quoted values separated by comma
-
from
public static DurationUnitConverter from(String unit)
-
-