APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.joptsimple.util

public abstract Class EnumConverter<E extends Enum<E>>

extends Object
implements ValueConverter<E extends Enum<E>>
Class Inheritance
All Implemented Interfaces
jdk.internal.joptsimple.ValueConverter
Imports
java.text.MessageFormat, java.util.EnumSet, .Iterator, .ResourceBundle, jdk.internal.joptsimple.ValueConversionException, .ValueConverter

Converts values to java.lang.Enums.
Author
Christian Ohr

Field Summary

Modifier and TypeField and Description
private final Class<E>
private String

Constructor Summary

AccessConstructor and Description
protected
EnumConverter(Class<E>
enum class
clazz
)

This constructor must be called by subclasses, providing the enum class as the parameter.

Method Summary

Modifier and TypeMethod and Description
public E
convert(String value)

Implements jdk.internal.joptsimple.ValueConverter.convert.

Converts the given string value into a Java type.

private String
message(String value)

public void
setDelimiters(String
delimiters for message string. Default is [,]
delimiters
)

Sets the delimiters for the message string.

public String
valuePattern()

Implements jdk.internal.joptsimple.ValueConverter.valuePattern.

Gives a string that describes the pattern of the values this converter expects, if any.

public Class<E>
valueType()

Implements jdk.internal.joptsimple.ValueConverter.valueType.

Gives the class of the type of values this converter converts to.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clazzback to summary
private final Class<E> clazz
delimitersback to summary
private String delimiters

Constructor Detail

EnumConverterback to summary
protected EnumConverter(Class<E> clazz)

This constructor must be called by subclasses, providing the enum class as the parameter.

Parameters
clazz:Class<E>

enum class

Method Detail

convertback to summary
public E convert(String value)

Implements jdk.internal.joptsimple.ValueConverter.convert.

Doc from jdk.internal.joptsimple.ValueConverter.convert.

Converts the given string value into a Java type.

Annotations
@Override
messageback to summary
private String message(String value)
setDelimitersback to summary
public void setDelimiters(String delimiters)

Sets the delimiters for the message string. Must be a 3-letter string, where the first character is the prefix, the second character is the delimiter between the values, and the 3rd character is the suffix.

Parameters
delimiters:String

delimiters for message string. Default is [,]

valuePatternback to summary
public String valuePattern()

Implements jdk.internal.joptsimple.ValueConverter.valuePattern.

Doc from jdk.internal.joptsimple.ValueConverter.valuePattern.

Gives a string that describes the pattern of the values this converter expects, if any. For example, a date converter can respond with a date format string.

Annotations
@Override
valueTypeback to summary
public Class<E> valueType()

Implements jdk.internal.joptsimple.ValueConverter.valueType.

Doc from jdk.internal.joptsimple.ValueConverter.valueType.

Gives the class of the type of values this converter converts to.

Annotations
@Override