Object LoadOptions.Companion
-
- All Implemented Interfaces:
public class LoadOptions.Companion
-
-
Field Summary
Fields Modifier and Type Field Description private final LoadOptionsDEFAULTprivate final Sequence<Field>optionFieldsprivate final Map<String, Field>optionFieldsMapprivate final Map<String, Object>defaultParamsprivate final Map<String, String>defaultArgsMapprivate final List<String>arity0BooleanParamsprivate final List<String>arity1BooleanParamsprivate final List<String>optionNamesprivate final List<String>apiPublicOptionNamesprivate final List<List<String>>helpListpublic final static LoadOptions.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final UnitsetFieldByAnnotation(LoadOptions options, String annotationName, Object value)Sets the value of a field based on its annotation name. final List<String>getOptionNames(String fieldName)Returns all option names for a given field. final LoadOptionscreate(VolatileConfig conf)Creates a new empty LoadOptions with the given configuration. final LoadOptionscreateUnsafe()Creates a new empty LoadOptions with an unsafe configuration. final Stringnormalize(String args)Normalizes arguments into a standard format. final LoadOptionsparse(String args, VolatileConfig conf)Parses a string of arguments into a LoadOptions object. final LoadOptionsparse(String args, LoadOptions options)Parses a string of arguments into a LoadOptions object based on another instance. final LoadOptionsmerge(LoadOptions o1, LoadOptions o2)Merges two LoadOptions objects, with o2 options taking precedence. final LoadOptionsmerge(LoadOptions o1, String args)Merges a LoadOptions object with additional arguments string. final LoadOptionsmerge(String args, String args2, VolatileConfig conf)Merges two argument strings into a single LoadOptions. final StringmergeArgs(String args, VolatileConfig conf)Merges multiple argument strings, with later arguments taking precedence. final StringeraseOptions(String args, String fieldNames)Removes specified options from an arguments string. final LoadOptionsgetDEFAULT()Default LoadOptions instance with standard settings. final Sequence<Field>getOptionFields()List of all option fields in the LoadOptions class. final Map<String, Field>getOptionFieldsMap()Map of field names to their corresponding Field objects. final Map<String, Object>getDefaultParams()Map of field names to their default values from DEFAULT instance. final Map<String, String>getDefaultArgsMap()Map of default option names and values. final List<String>getArity0BooleanParams()List of zero-arity boolean parameter names. final List<String>getArity1BooleanParams()List of single-arity boolean parameter names. final List<String>getOptionNames()List of all option names from parameter annotations. final List<String>getApiPublicOptionNames()List of option names that are marked as API public. final List<List<String>>getHelpList()-
-
Method Detail
-
setFieldByAnnotation
final Unit setFieldByAnnotation(LoadOptions options, String annotationName, Object value)
Sets the value of a field based on its annotation name.
- Parameters:
options- the LoadOptions instance to modifyannotationName- the annotation name to search forvalue- the value to set
-
getOptionNames
final List<String> getOptionNames(String fieldName)
Returns all option names for a given field.
- Parameters:
fieldName- the field name to look up- Returns:
list of all option names for that field
-
create
final LoadOptions create(VolatileConfig conf)
Creates a new empty LoadOptions with the given configuration.
- Parameters:
conf- the configuration to use- Returns:
a new LoadOptions instance
-
createUnsafe
final LoadOptions createUnsafe()
Creates a new empty LoadOptions with an unsafe configuration.
- Returns:
a new LoadOptions instance
-
normalize
final String normalize(String args)
Normalizes arguments into a standard format.
- Parameters:
args- the arguments to normalize- Returns:
normalized arguments string
-
parse
final LoadOptions parse(String args, VolatileConfig conf)
Parses a string of arguments into a LoadOptions object.
- Parameters:
args- the arguments string to parseconf- the configuration to use- Returns:
the parsed LoadOptions
-
parse
final LoadOptions parse(String args, LoadOptions options)
Parses a string of arguments into a LoadOptions object based on another instance.
- Parameters:
args- the arguments string to parseoptions- the base options to use- Returns:
the parsed LoadOptions
-
merge
final LoadOptions merge(LoadOptions o1, LoadOptions o2)
Merges two LoadOptions objects, with o2 options taking precedence.
- Parameters:
o1- the base optionso2- the overriding options- Returns:
a new merged LoadOptions
-
merge
final LoadOptions merge(LoadOptions o1, String args)
Merges a LoadOptions object with additional arguments string.
- Parameters:
o1- the base optionsargs- the overriding arguments- Returns:
a new merged LoadOptions
-
merge
final LoadOptions merge(String args, String args2, VolatileConfig conf)
Merges two argument strings into a single LoadOptions.
- Parameters:
args- the base argumentsargs2- the overriding argumentsconf- the configuration to use- Returns:
a new merged LoadOptions
-
mergeArgs
final String mergeArgs(String args, VolatileConfig conf)
Merges multiple argument strings, with later arguments taking precedence.
- Parameters:
args- the argument strings to mergeconf- the configuration to use- Returns:
the merged arguments string
-
eraseOptions
final String eraseOptions(String args, String fieldNames)
Removes specified options from an arguments string.
- Parameters:
args- the original arguments stringfieldNames- the field names to remove- Returns:
the modified arguments string
-
getDEFAULT
final LoadOptions getDEFAULT()
Default LoadOptions instance with standard settings. Used as a base for comparison and default values.
-
getOptionFields
final Sequence<Field> getOptionFields()
List of all option fields in the LoadOptions class. Contains fields with Parameter annotations for option parsing.
-
getOptionFieldsMap
final Map<String, Field> getOptionFieldsMap()
Map of field names to their corresponding Field objects.
-
getDefaultParams
final Map<String, Object> getDefaultParams()
Map of field names to their default values from DEFAULT instance.
-
getDefaultArgsMap
final Map<String, String> getDefaultArgsMap()
Map of default option names and values.
-
getArity0BooleanParams
final List<String> getArity0BooleanParams()
List of zero-arity boolean parameter names. These are parameters that don't require a value (flag parameters).
-
getArity1BooleanParams
final List<String> getArity1BooleanParams()
List of single-arity boolean parameter names. These are boolean parameters that require a value.
-
getOptionNames
final List<String> getOptionNames()
List of all option names from parameter annotations.
-
getApiPublicOptionNames
final List<String> getApiPublicOptionNames()
List of option names that are marked as API public. These options are exposed through REST APIs.
-
getHelpList
final List<List<String>> getHelpList()
-
-
-
-