Object LoadOptions.Companion
-
- All Implemented Interfaces:
public class LoadOptions.Companion
-
-
Field Summary
Fields Modifier and Type Field Description private final LoadOptionsDEFAULTprivate final List<LoadOptions.OptionDescriptor<?>>optionDescriptorsprivate final Map<String, LoadOptions.OptionDescriptor<?>>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 <Error class: unknown class>create(VolatileConfig conf)Creates a new empty LoadOptions with the given configuration. final <Error class: unknown class>createUnsafe()Creates a new empty LoadOptions with an unsafe configuration. final <Error class: unknown class>normalize(String args)Normalizes arguments into a standard format. final <Error class: unknown class>parse(String args, VolatileConfig conf)Parses a string of arguments into a LoadOptions object. final <Error class: unknown class>parse(String args, LoadOptions options)Parses a string of arguments into a LoadOptions object based on another instance. final <Error class: unknown class>merge(LoadOptions o1, LoadOptions o2)Merges two LoadOptions objects, with o2 options taking precedence. final <Error class: unknown class>merge(LoadOptions o1, String args)Merges a LoadOptions object with additional arguments string. final <Error class: unknown class>merge(String args, String args2, VolatileConfig conf)Merges two argument strings into a single LoadOptions. final <Error class: unknown class>mergeArgs(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 List<LoadOptions.OptionDescriptor<?>>getOptionDescriptors()final Map<String, LoadOptions.OptionDescriptor<?>>getOptionFieldsMap()Map of field names to their corresponding OptionDescriptor. 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 (flag parameters). final List<String>getArity1BooleanParams()List of single-arity boolean parameter names. final List<String>getOptionNames()List of all option names. 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 <Error class: unknown class> 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 <Error class: unknown class> createUnsafe()
Creates a new empty LoadOptions with an unsafe configuration.
- Returns:
a new LoadOptions instance
-
normalize
final <Error class: unknown class> normalize(String args)
Normalizes arguments into a standard format.
- Parameters:
args- the arguments to normalize- Returns:
normalized arguments string
-
parse
final <Error class: unknown class> 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 <Error class: unknown class> 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 <Error class: unknown class> 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 <Error class: unknown class> 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 <Error class: unknown class> 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 <Error class: unknown class> 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.
-
getOptionDescriptors
final List<LoadOptions.OptionDescriptor<?>> getOptionDescriptors()
-
getOptionFieldsMap
final Map<String, LoadOptions.OptionDescriptor<?>> getOptionFieldsMap()
Map of field names to their corresponding OptionDescriptor.
-
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 (flag parameters).
-
getArity1BooleanParams
final List<String> getArity1BooleanParams()
List of single-arity boolean parameter names.
-
getOptionNames
final List<String> getOptionNames()
List of all option names.
-
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()
-
-
-
-