Package com.github.dakusui.symfonion.cli
Record Class Cli
java.lang.Object
java.lang.Record
com.github.dakusui.symfonion.cli.Cli
- Record Components:
subcommand- A sub command to be executed by this object.source- A source file to be processed.sink- A sink (output) file to which processed result should be written.routeRequest- An object to specify routing of MIDI signals.midiInRegexPatterns- An object that maps logical midi input port name to a device name.midiOutRegexPatterns- An object that maps logical midi output port name to a device name.barFilter- A predicate that filters musical bars. Used with-cand-poptions.measureFilter- A predicate that filters musical measures. Used with-xand-qoptions.partFilter- A predicate that filters parts.options- An object that models command line options.symfonion- This application’s facade object.
public record Cli(Subcommand subcommand, File source, File sink, MidiRouteRequest routeRequest, Map<String,Pattern> midiInRegexPatterns, Map<String,Pattern> midiOutRegexPatterns, Predicate<Bar> barFilter, Predicate<Measure> measureFilter, Predicate<String> partFilter, org.apache.commons.cli.Options options, Symfonion symfonion)
extends Record
A class that models a single CLI invocation.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCli(Subcommand subcommand, File source, File sink, MidiRouteRequest routeRequest, Map<String, Pattern> midiInRegexPatterns, Map<String, Pattern> midiOutRegexPatterns, Predicate<Bar> barFilter, Predicate<Measure> measureFilter, Predicate<String> partFilter, org.apache.commons.cli.Options options, Symfonion symfonion) Creates an instance of aClirecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebarFilterrecord component.static Cli.BuilderA synonym fornew Builder(String… args).final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.voidinvoke(PrintStream stdout, InputStream in) Invokes this object.static intinvoke(PrintStream stdout, PrintStream stderr, String... args) Invokes the SyMFONION application with given command line arguments.static voidThe application’s entry point.Returns the value of themeasureFilterrecord component.Returns the value of themidiInRegexPatternsrecord component.Returns the value of themidiOutRegexPatternsrecord component.org.apache.commons.cli.Optionsoptions()Returns the value of theoptionsrecord component.Returns the value of thepartFilterrecord component.Returns the value of therouteRequestrecord component.sink()Returns the value of thesinkrecord component.source()Returns the value of thesourcerecord component.Returns the value of thesubcommandrecord component.Returns the value of thesymfonionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Cli
public Cli(Subcommand subcommand, File source, File sink, MidiRouteRequest routeRequest, Map<String, Pattern> midiInRegexPatterns, Map<String, Pattern> midiOutRegexPatterns, Predicate<Bar> barFilter, Predicate<Measure> measureFilter, Predicate<String> partFilter, org.apache.commons.cli.Options options, Symfonion symfonion) Creates an instance of aClirecord class.- Parameters:
subcommand- the value for thesubcommandrecord componentsource- the value for thesourcerecord componentsink- the value for thesinkrecord componentrouteRequest- the value for therouteRequestrecord componentmidiInRegexPatterns- the value for themidiInRegexPatternsrecord componentmidiOutRegexPatterns- the value for themidiOutRegexPatternsrecord componentbarFilter- the value for thebarFilterrecord componentmeasureFilter- the value for themeasureFilterrecord componentpartFilter- the value for thepartFilterrecord componentoptions- the value for theoptionsrecord componentsymfonion- the value for thesymfonionrecord component
-
-
Method Details
-
invoke
Invokes this object.
- Parameters:
stdout- A print stream to which the output of the execution goes.in- An input stream from which the executed subcommand reads data.- Throws:
IOException- A failure detected during execution.
-
invoke
Invokes the SyMFONION application with given command line arguments.
- Parameters:
stdout- A print stream to which stdout data are printed.stderr- A print stream to which stderr data are printed.args- Command line arguments.- Returns:
- An exit code.
-
cli
A synonym for
new Builder(String… args). Prefer this over directly callingnew Builder(String… args)for readability’s sake.- Parameters:
args- Commandline arguments- Returns:
- A new
Cli.Builderobject
-
main
The application’s entry point.
- Parameters:
args- Given command line arguments.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
subcommand
Returns the value of thesubcommandrecord component.- Returns:
- the value of the
subcommandrecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
sink
Returns the value of thesinkrecord component.- Returns:
- the value of the
sinkrecord component
-
routeRequest
Returns the value of therouteRequestrecord component.- Returns:
- the value of the
routeRequestrecord component
-
midiInRegexPatterns
Returns the value of themidiInRegexPatternsrecord component.- Returns:
- the value of the
midiInRegexPatternsrecord component
-
midiOutRegexPatterns
Returns the value of themidiOutRegexPatternsrecord component.- Returns:
- the value of the
midiOutRegexPatternsrecord component
-
barFilter
Returns the value of thebarFilterrecord component.- Returns:
- the value of the
barFilterrecord component
-
measureFilter
Returns the value of themeasureFilterrecord component.- Returns:
- the value of the
measureFilterrecord component
-
partFilter
Returns the value of thepartFilterrecord component.- Returns:
- the value of the
partFilterrecord component
-
options
public org.apache.commons.cli.Options options()Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-
symfonion
Returns the value of thesymfonionrecord component.- Returns:
- the value of the
symfonionrecord component
-