Top Description Fields Constructors Methods
io.vertx.core.cli.converters

public Class Converters

extends Object
Class Inheritance
Imports
java.lang.reflect.InvocationTargetException, java.util.Collections, .HashMap, .Map, .NoSuchElementException

Entry point to the converter system.
Author
Clement Escoffier

Field Summary

Modifier and TypeField and Description
private static final Map<Class<?>, Class<?>>
private static final Map<Class<?>, Converter<?>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static <T> T
create(Class<T> type, String value)

public static <T> T
create(String value, Converter<T> converter)

private static <
the class
T
>
Converter<T>

Returns:

the parameter converter able to creates instances of the target type from String representations.
getConverter
(Class<T>
the target type
type
)

Searches a suitable converter to convert String to the given type.

public static <T> Converter<T>
newInstance(Class<? extends Converter<T>> type)

private static <T> Class<T>
wrap(Class<T> type)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

PRIMITIVE_TO_WRAPPER_TYPEback to summary
private static final Map<Class<?>, Class<?>> PRIMITIVE_TO_WRAPPER_TYPE
WELL_KNOWN_CONVERTERSback to summary
private static final Map<Class<?>, Converter<?>> WELL_KNOWN_CONVERTERS

Constructor Detail

Convertersback to summary
public Converters()

Method Detail

createback to summary
public static <T> T create(Class<T> type, String value)
createback to summary
public static <T> T create(String value, Converter<T> converter)
getConverterback to summary
private static <T> Converter<T> getConverter(Class<T> type)

Searches a suitable converter to convert String to the given type.

Parameters
<T>
the class
type:Class<T>

the target type

Returns:Converter<T>

the parameter converter able to creates instances of the target type from String representations.

Annotations
@SuppressWarnings:unchecked
Exceptions
NoSuchElementException:
if no converter can be found
newInstanceback to summary
public static <T> Converter<T> newInstance(Class<? extends Converter<T>> type) throws IllegalArgumentException
wrapback to summary
private static <T> Class<T> wrap(Class<T> type)
Annotations
@SuppressWarnings:unchecked