Klasse DurationConverter
java.lang.Object
org.apache.commons.beanutils.converters.AbstractConverter
org.apache.torque.dsfactory.converters.DurationConverter
- Alle implementierten Schnittstellen:
org.apache.commons.beanutils.Converter
public final class DurationConverter
extends org.apache.commons.beanutils.converters.AbstractConverter
Converter implementation that handles conversion
to and from java.time.Duration objects.
Can be configured to either return a default value or throw a
ConversionException if a conversion error occurs.
- Seit:
- 1.3
- Version:
- $Id$
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungConstruct a java.time.Duration Converter that throws aConversionExceptionif an error occurs.DurationConverter(boolean useTextFormat) Construct a java.time.DurationL Converter that throws aConversionExceptionif an error occurs.DurationConverter(Object defaultValue) Construct a java.time.DurationL Converter that returns a default value if an error occurs.DurationConverter(Object defaultValue, boolean useTextFormat) Construct a java.time.DurationL Converter that returns a default value if an error occurs. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected <T> TconvertToType(Class<T> type, Object value) Convert a String to a java.time.Duration.protected Class<?>Return the default type thisConverterhandles.Von Klasse geerbte Methoden org.apache.commons.beanutils.converters.AbstractConverter
conversionException, convert, convertArray, convertToString, getDefault, handleError, handleMissing, isUseDefault, setDefaultValue, toString
-
Konstruktordetails
-
DurationConverter
public DurationConverter()Construct a java.time.Duration Converter that throws aConversionExceptionif an error occurs. -
DurationConverter
Construct a java.time.DurationL Converter that returns a default value if an error occurs.- Parameter:
defaultValue- The default value to be returned if the value to be converted is missing or an error occurs converting the value.useTextFormat- if values are in ISO8901 formats.
-
DurationConverter
Construct a java.time.DurationL Converter that returns a default value if an error occurs.- Parameter:
defaultValue- The default value to be returned if the value to be converted is missing or an error occurs converting the value.
-
DurationConverter
public DurationConverter(boolean useTextFormat) Construct a java.time.DurationL Converter that throws aConversionExceptionif an error occurs.- Parameter:
useTextFormat- if values are in ISO8901 formats.
-
-
Methodendetails
-
getDefaultType
Return the default type thisConverterhandles.- Angegeben von:
getDefaultTypein Klasseorg.apache.commons.beanutils.converters.AbstractConverter- Gibt zurück:
- The default type this
Converterhandles. - Seit:
- 1.8.0
-
convertToType
Convert a String to a java.time.Duration.
- Angegeben von:
convertToTypein Klasseorg.apache.commons.beanutils.converters.AbstractConverter- Typparameter:
T- Target type of the conversion.- Parameter:
type- Data type to which this value should be converted.value- The input value to be converted.- Gibt zurück:
- The converted value.
- Löst aus:
Throwable- if an error occurs converting to the specified type
-