Package joptsimple.util
Class InetAddressConverter
java.lang.Object
joptsimple.util.InetAddressConverter
- All Implemented Interfaces:
ValueConverter<java.net.InetAddress>
public class InetAddressConverter extends java.lang.Object implements ValueConverter<java.net.InetAddress>
Converts values to
InetAddress using getByName.-
Constructor Summary
Constructors Constructor Description InetAddressConverter() -
Method Summary
Modifier and Type Method Description java.net.InetAddressconvert(java.lang.String value)Converts the given string value into a Java type.java.lang.StringvaluePattern()Gives a string that describes the pattern of the values this converter expects, if any.java.lang.Class<java.net.InetAddress>valueType()Gives the class of the type of values this converter converts to.
-
Constructor Details
-
InetAddressConverter
public InetAddressConverter()
-
-
Method Details
-
convert
public java.net.InetAddress convert(java.lang.String value)Description copied from interface:ValueConverterConverts the given string value into a Java type.- Specified by:
convertin interfaceValueConverter<java.net.InetAddress>- Parameters:
value- the string to convert- Returns:
- the converted value
-
valueType
public java.lang.Class<java.net.InetAddress> valueType()Description copied from interface:ValueConverterGives the class of the type of values this converter converts to.- Specified by:
valueTypein interfaceValueConverter<java.net.InetAddress>- Returns:
- the target class for conversion
-
valuePattern
public java.lang.String valuePattern()Description copied from interface:ValueConverterGives a string that describes the pattern of the values this converter expects, if any. For example, a date converter can respond with adate format string.- Specified by:
valuePatternin interfaceValueConverter<java.net.InetAddress>- Returns:
- a value pattern, or
nullif there's nothing interesting here
-