public class DurationConverter extends AbstractBaseConverter<Duration>
String into a Duration.
For a description of the format, see Period.parse(CharSequence).
Example:
@Parameter(names = { "--duration" }, converter = DurationConverter.class)
private Duration duration;
Duration,
Duration.parse(CharSequence)failOnNull, targetClass| Constructor and Description |
|---|
DurationConverter(String optionName)
Constructs a converter.
|
| Modifier and Type | Method and Description |
|---|---|
protected Duration |
convertImpl(String value)
Converts a value.
|
convert, getErrorString, isSingle, newParameterException, newParameterException, split, toInt, toURIpublic DurationConverter(String optionName)
optionName - The option name, may be null.protected Duration convertImpl(String value)
AbstractBaseConverterconvertImpl in class AbstractBaseConverter<Duration>value - the value to convertCopyright © 2016-2016 Gary Gregory. All Rights Reserved.
Use is subject to The Apache Software License, Version 2.0