Top Fields Constructors Methods
org.xnio

pack-priv final Class SingleOption<T>

extends Option<T>
Class Inheritance
Static Imports
org.xnio._private.Messages.msg

Author
David M. Lloyd

Field Summary

Modifier and TypeField and Description
private final transient Option.ValueParser<T>
private static final long
private final transient Class<T>

Constructor Summary

AccessConstructor and Description
pack-priv
SingleOption(final Class<?> declClass, final String name, final Class<T> type)

Method Summary

Modifier and TypeMethod and Description
public T
cast(final Object
the object to cast
o
)

Implements abstract org.xnio.Option.cast.

Return the given object as the type of this option.

public T
parseValue(final String
the string
string
,
final ClassLoader
the class loader to use to parse the value
classLoader
)

Implements abstract org.xnio.Option.parseValue.

Parse a string value for this option.

Inherited from org.xnio.Option:
castfromStringgetClassParsergetEnumParsergetNamegetParserreadResolvesequencesetBuildersimpletoStringtypetypeSequence

Field Detail

parserback to summary
private final transient Option.ValueParser<T> parser
serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.xnio.Option.serialVersionUID.

typeback to summary
private final transient Class<T> type

Constructor Detail

SingleOptionback to summary
pack-priv SingleOption(final Class<?> declClass, final String name, final Class<T> type)

Method Detail

castback to summary
public T cast(final Object o)

Implements abstract org.xnio.Option.cast.

Doc from org.xnio.Option.cast.

Return the given object as the type of this option. If the cast could not be completed, an exception is thrown.

Parameters
o:Object

the object to cast

Returns:T

the cast object

parseValueback to summary
public T parseValue(final String string, final ClassLoader classLoader) throws IllegalArgumentException

Implements abstract org.xnio.Option.parseValue.

Doc from org.xnio.Option.parseValue.

Parse a string value for this option.

Parameters
string:String

the string

classLoader:ClassLoader

the class loader to use to parse the value

Returns:T

the parsed value

Exceptions
IllegalArgumentException:
if the argument could not be parsed