Class IoOptions
Option
instances
that can be used for command line parsing.-
Field Summary
FieldsModifier and TypeFieldDescriptionRepresents an option for specifying the character encoding to be used in various text-based operations.static final Option
<PredefinedDateTimeFormat> Represents an option for specifying the date and time format to be used in various operations.Defines an option for specifying the field separator character.A predefined constant representing the input path option.Represents an option for specifying theLocale
to be used in various operations.An option for specifying the output path.Represents an optional configuration for specifying the character used as a text delimiter in input or output operations. -
Method Summary
Modifier and TypeMethodDescriptionCreates an option for character encoding selection.static Option
<PredefinedDateTimeFormat> dateFormat
(Supplier<PredefinedDateTimeFormat> defaultSupplier) Creates an option for specifying the date format to be used in various operations.fieldSeparator
(Supplier<Character> defaultSupplier) Creates an option for specifying the field separator character.Creates an option for specifying the input path.Creates an option for selecting the locale.Creates an option for specifying the output path.textDelimiter
(Supplier<Character> defaultSupplier) Creates an option for specifying the text delimiter for quoted texts.
-
Field Details
-
OPTION_CHARSET
Represents an option for specifying the character encoding to be used in various text-based operations. This option allows users to define a custom character encoding, and defaults to UTF-8 if no encoding is specified. -
OPTION_DATE_TIME_FORMAT
Represents an option for specifying the date and time format to be used in various operations. This option allows the user to select a predefined date and time format, enabling consistent parsing or formatting of date-time values.The default value for this option is
PredefinedDateTimeFormat.ISO_DATE_TIME
, which supports the ISO-8601 date-time format. -
OPTION_FIELD_SEPARATOR
Defines an option for specifying the field separator character. This option allows customization of the character used to separate fields within the same row during data processing, such as in CSV files.The default field separator is provided by a
Supplier
that specifies a default value, which is a comma (`,`).This option can be used to align the field separator configuration with the data formatting requirements of specific use cases.
-
OPTION_TEXT_DELIMITER
Represents an optional configuration for specifying the character used as a text delimiter in input or output operations. This option is typically used to define the character that delimits quoted text, such as when handling CSV or similar structured text formats.By default, the text delimiter is set to the double-quote character (`"`).
The
textDelimiter
method is used to initialize this option with a default character, supplied through aSupplier<Character>
.This option allows flexibility by enabling customization of the quoted text delimiter to suit various input or output data formats.
-
OPTION_INPUT
A predefined constant representing the input path option. This option allows the user to specify the path to the input data. The default path is determined by the provided supplier, which can returnnull
.- See Also:
-
OPTION_OUTPUT
An option for specifying the output path. This option allows users to define the path where the output data will be written.The option is created using a default
Supplier
that can provide a default output path if none is explicitly specified.The provided
Supplier
for the default value returnsnull
by default, indicating that no output path is specified unless explicitly set. -
OPTION_LOCALE
Represents an option for specifying theLocale
to be used in various operations. This option allows configuring regional settings, such as language and formatting conventions, applicable for tasks like reading or writing files.The default locale is provided by invoking the
Locale::getDefault
method, which retrieves the system's default locale settings.Use this option when a specific locale must be set or when the default system locale suffices.
-
-
Method Details
-
charset
Creates an option for character encoding selection. This method defines a customizable option that allows the user to specify a character encoding from the available system character sets.- Parameters:
defaultSupplier
- aSupplier
that provides the default character encoding if none is specified- Returns:
- an
Option<Charset>
representing the character encoding selection
-
locale
Creates an option for selecting the locale. This option allows specifying the locale to be used when performing operations such as reading or writing files. The locale defines regional settings such as language and formatting conventions.- Parameters:
defaultSupplier
- aSupplier
that provides the default locale if none is explicitly specified- Returns:
- an
Option<Locale>
representing the locale selection
-
input
Creates an option for specifying the input path. This option allows the user to define the path where the input data is located.- Parameters:
defaultSupplier
- aSupplier
that provides the default input path if none is explicitly specified. The supplied path can benull
.- Returns:
- an
Option<Path>
representing the input path option.
-
output
Creates an option for specifying the output path. This option allows the user to define the path where the output data will be written.- Parameters:
defaultSupplier
- aSupplier
that provides the default output path if none is explicitly specified. The supplied path can benull
.- Returns:
- an
Option<Path>
representing the output path option.
-
textDelimiter
Creates an option for specifying the text delimiter for quoted texts. This option allows the user to define the character used as a text delimiter when handling quoted text in input or output operations.- Parameters:
defaultSupplier
- aSupplier
that provides the default text delimiter if none is explicitly specified- Returns:
- an
Option<Character>
representing the text delimiter option
-
fieldSeparator
Creates an option for specifying the field separator character. This option allows the user to define the character used to separate fields within the same row of data.- Parameters:
defaultSupplier
- aSupplier<Character>
that provides the default field separator character if none is explicitly specified- Returns:
- an
Option<Character>
representing the field separator option
-
dateFormat
public static Option<PredefinedDateTimeFormat> dateFormat(Supplier<PredefinedDateTimeFormat> defaultSupplier) Creates an option for specifying the date format to be used in various operations. This method allows the user to select a predefined date and time format.- Parameters:
defaultSupplier
- aSupplier
that provides the default date format if none is explicitly specified- Returns:
- an
Option<PredefinedDateTimeFormat>
representing the configurable date format option
-