Package com.fasterxml.jackson.datatype.jsr310.util

# Class DurationUnitConverter

java.lang.Object
com.fasterxml.jackson.datatype.jsr310.util.DurationUnitConverter

public class DurationUnitConverter extends Object
Handles the conversion of the duration based on the API of `Duration` for a restricted set of `ChronoUnit`. Only the units considered as accurate are supported in this converter since are the only ones capable of handling deserialization in a precise manner (see `ChronoUnit.isDurationEstimated()`).

Since:
  2.12

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`protected static class`
`DurationUnitConverter.DurationSerialization`

## Method Summary

Modifier and Type
Method
Description
`Duration`
`convert(long value)`
`long`
`convert(Duration duration)`
`static String`
`descForAllowed()`
`static DurationUnitConverter`
`from(String unit)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### convert

public Duration convert(long value)

### convert

public long convert(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)