public class OptionMaster extends Object
Modifier and Type | Class and Description |
---|---|
static class |
OptionMaster.OptionPlatform
Option s can be either platform-specific or applicable to all
platforms. |
static class |
OptionMaster.Type
The different types of
Option s. |
static class |
OptionMaster.Visibility
Different ways that an
Option might be displayed. |
Modifier and Type | Field and Description |
---|---|
Object[][] |
blahblah |
static String |
EMPTY_STRING |
private static OptionMaster |
instance |
private Map<String,? extends Option> |
optionMap
Maps an option ID to the corresponding object.
|
static char |
QUOTE_CHAR |
static String |
QUOTE_STRING |
static String |
SET_PREFIX |
Constructor and Description |
---|
OptionMaster() |
public static final String SET_PREFIX
public static final String EMPTY_STRING
public static final String QUOTE_STRING
public static final char QUOTE_CHAR
private Map<String,? extends Option> optionMap
private static OptionMaster instance
public OptionMaster()
public static OptionMaster getInstance()
private Map<String,Option> buildOptions(Object[][] options)
Option
object.options
- An array specifying the Option
s to be built.Option
.AssertionError
- if the option array contained an entry that
this method cannot build.protected OptionMaster.OptionPlatform convertToOptionPlatform()
Platform
to its corresponding
OptionMaster.OptionPlatform
type.OptionPlatform
type.AssertionError
- if StartupManager.getPlatform()
returned something that this method cannot convert.private Option getOption(String id)
Option
mapped to id
.id
- The ID whose associated Option
is to be returned.Option
associated with id
, or
null
if there was no association.getMemoryOption(java.lang.String)
,
getBooleanOption(java.lang.String)
,
getDirectoryOption(java.lang.String)
,
getSliderOption(java.lang.String)
,
getTextOption(java.lang.String)
,
getLoggerLevelOption(java.lang.String)
,
getFileOption(java.lang.String)
public MemoryOption getMemoryOption(String id)
id
- Identifier for the desired MemoryOption
.
Should not be null
.MemoryOption
that corresponds to id
or null
.public BooleanOption getBooleanOption(String id)
id
- Identifier for the desired BooleanOption
.
Should not be null
.BooleanOption
that corresponds to id
or null
.public DirectoryOption getDirectoryOption(String id)
id
- Identifier for the desired DirectoryOption
.
Should not be null
.DirectoryOption
that corresponds to
id
or null
.public SliderOption getSliderOption(String id)
id
- Identifier for the desired SliderOption
.
Should not be null
.SliderOption
that corresponds to id
or null
.public TextOption getTextOption(String id)
id
- Identifier for the desired TextOption
.
Should not be null
.TextOption
that corresponds to id
or null
.public LoggerLevelOption getLoggerLevelOption(String id)
id
- Identifier for the desired LoggerLevelOption
.
Should not be null
.LoggerLevelOption
that corresponds to id
or null
.public FileOption getFileOption(String id)
public Collection<Option> getAllOptions()
Collection
.public List<Option> optionsByPlatform(Collection<OptionMaster.OptionPlatform> platforms)
Options
applicable to the given
OptionPlatforms
.platforms
- Desired platforms. Cannot be null
.List
of {code Option}-s applicable to
platforms
or an empty List
.public List<Option> optionsByType(Collection<OptionMaster.Type> types)
types
- Desired Option
types. Cannot be null
.List
of Option
-s that match the given
types or an empty List
.public List<Option> optionsByVisibility(Collection<OptionMaster.Visibility> visibilities)
Options
that match the given levels of
visibility
.visibilities
- Desired visibility levels. Cannot be null
.List
of Option
-s that match the given
visibility levels or an empty List
.private void normalizeUserDirectory()
public void readStartup()
public void writeStartup()