Package ubic.gemma.cli.util
Class EnumeratedStringConverter
java.lang.Object
ubic.gemma.cli.util.EnumeratedStringConverter
- All Implemented Interfaces:
org.apache.commons.cli.Converter<String,
,IllegalArgumentException> EnumeratedConverter<String,
IllegalArgumentException>
public class EnumeratedStringConverter
extends Object
implements EnumeratedConverter<String,IllegalArgumentException>
A string converter that can only convert from a finite set of possible values.
- Author:
- poirigui
-
Field Summary
Fields inherited from interface org.apache.commons.cli.Converter
CLASS, DATE, DEFAULT, FILE, NUMBER, OBJECT, PATH, URL
-
Method Summary
Modifier and TypeMethodDescriptionObtain a list of possible values that the converter can convert toEnumeratedConverter
.static EnumeratedStringConverter
static EnumeratedStringConverter
-
Method Details
-
of
-
of
public static EnumeratedStringConverter of(Map<String, org.springframework.context.MessageSourceResolvable> descriptions) -
getPossibleValues
Description copied from interface:EnumeratedConverter
Obtain a list of possible values that the converter can convert toEnumeratedConverter
.Implementation should use either a
SortedMap
orLinkedHashMap
for reproducibility.- Specified by:
getPossibleValues
in interfaceEnumeratedConverter<String,
IllegalArgumentException>
-
apply
- Specified by:
apply
in interfaceorg.apache.commons.cli.Converter<String,
IllegalArgumentException> - Throws:
IllegalArgumentException
-