Object LoadOptions.Companion
-
- All Implemented Interfaces:
public class LoadOptions.Companion
-
-
Field Summary
Fields Modifier and Type Field Description private final LoadOptionsDEFAULTprivate final <Error class: unknown class>optionFieldsprivate final <Error class: unknown class>optionFieldsMapprivate final <Error class: unknown class>defaultParamsprivate final Map<String, String>defaultArgsMapprivate final <Error class: unknown class>arity0BooleanParamsprivate final <Error class: unknown class>arity1BooleanParamsprivate final <Error class: unknown class>optionNamesprivate final <Error class: unknown class>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 <Error class: unknown class>getOptionFields()List of all option fields in the LoadOptions class. final <Error class: unknown class>getOptionFieldsMap()Map of field names to their corresponding Field objects. final <Error class: unknown class>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 <Error class: unknown class>getArity0BooleanParams()List of zero-arity boolean parameter names. final <Error class: unknown class>getArity1BooleanParams()List of single-arity boolean parameter names. final <Error class: unknown class>getOptionNames()List of all option names from parameter annotations. final <Error class: unknown class>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.
-
getOptionFields
final <Error class: unknown class> getOptionFields()
List of all option fields in the LoadOptions class. Contains fields with Parameter annotations for option parsing.
-
getOptionFieldsMap
final <Error class: unknown class> getOptionFieldsMap()
Map of field names to their corresponding Field objects.
-
getDefaultParams
final <Error class: unknown class> 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 <Error class: unknown class> getArity0BooleanParams()
List of zero-arity boolean parameter names. These are parameters that don't require a value (flag parameters).
-
getArity1BooleanParams
final <Error class: unknown class> getArity1BooleanParams()
List of single-arity boolean parameter names. These are boolean parameters that require a value.
-
getOptionNames
final <Error class: unknown class> getOptionNames()
List of all option names from parameter annotations.
-
getApiPublicOptionNames
final <Error class: unknown class> getApiPublicOptionNames()
List of option names that are marked as API public. These options are exposed through REST APIs.
-
getHelpList
final List<List<String>> getHelpList()
-
-
-
-