public static class TimeUnit.Converter extends Object implements IntegerUnit.Converter
| Constructor and Description |
|---|
Converter() |
| Modifier and Type | Method and Description |
|---|---|
long |
convert(long value,
Class<? extends IntegerUnit> from,
Class<? extends IntegerUnit> to)
Convert a value.
|
long |
convertFromMilliseconds(long value,
Class<? extends IntegerUnit> unit)
Convert a value from milliseconds.
|
long |
convertToMilliseconds(long value,
Class<? extends IntegerUnit> unit)
Convert a value into milliseconds.
|
boolean |
supportConversion(Class<? extends IntegerUnit> from,
Class<? extends IntegerUnit> to)
Return true if the conversion is supported.
|
public boolean supportConversion(Class<? extends IntegerUnit> from, Class<? extends IntegerUnit> to)
IntegerUnit.ConvertersupportConversion in interface IntegerUnit.Converterpublic long convert(long value,
Class<? extends IntegerUnit> from,
Class<? extends IntegerUnit> to)
throws IntegerUnit.UnitConversionException
IntegerUnit.Converterconvert in interface IntegerUnit.ConverterIntegerUnit.UnitConversionExceptionpublic long convertToMilliseconds(long value,
Class<? extends IntegerUnit> unit)
throws IntegerUnit.UnitConversionException
public long convertFromMilliseconds(long value,
Class<? extends IntegerUnit> unit)
throws IntegerUnit.UnitConversionException
Copyright © 2019. All rights reserved.