Class InetAddressConverter
java.lang.Object
org.apache.commons.beanutils2.converters.AbstractConverter<InetAddress>
org.apache.commons.beanutils2.converters.InetAddressConverter
- All Implemented Interfaces:
Converter<InetAddress>
Converter implementation that handles conversion to and from InetAddress.- Since:
- 2.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct aInetAddressConverter that throws aConversionExceptionif an error occurs.InetAddressConverter(InetAddress defaultValue) Constructs aConverterthat will return the specified default value if a conversion error occurs. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> TconvertToType(Class<T> type, Object value) Converts the specified input object into an output object of the specified type.protected Class<InetAddress> Gets the default type thisConverterhandles.Methods inherited from class org.apache.commons.beanutils2.converters.AbstractConverter
conversionException, convert, convertArray, convertToString, getDefault, handleError, handleMissing, isUseDefault, setDefaultValue, toLowerCase, toString, toString, toTrim
-
Constructor Details
-
InetAddressConverter
public InetAddressConverter()Construct aInetAddressConverter that throws aConversionExceptionif an error occurs. -
InetAddressConverter
Constructs aConverterthat will return the specified default value if a conversion error occurs.- Parameters:
defaultValue- The default value to be returned if the value to be converted is missing or an error occurs converting the value.
-
-
Method Details
-
convertToType
Converts the specified input object into an output object of the specified type.- Specified by:
convertToTypein classAbstractConverter<InetAddress>- Type Parameters:
T- Target type of the conversion.- Parameters:
type- Data type to which this value should be converted.value- The String property value to convert.- Returns:
- An
InetAddresswhich represents the configuration property value. - Throws:
NullPointerException- If the value is null.IllegalArgumentException- If a host name was specified and the IP address couldn't be obtained.Throwable- if an error occurs converting to the specified type
-
getDefaultType
Gets the default type thisConverterhandles.- Specified by:
getDefaultTypein classAbstractConverter<InetAddress>- Returns:
- The default type this
Converterhandles. - Since:
- 2.0.0
-