java.lang.Object
java.lang.Record
com.github.sormuras.bach.command.JarCommand
- Record Components:
mode
- The main operation mode like--create
,--list
, or--update
.file
- Specifies the archive file name.main
- Specifies the entry point for standalone applications bundled into a JAR file.verbose
- Sends or prints verbose output to standard output.additionals
- Aggregates additional command-line arguments.files
- Specifies the classes and resources to operate on.
- All Implemented Interfaces:
Command<JarCommand>
public record JarCommand(JarCommand.ModeOption mode, JarCommand.FileOption file, JarCommand.MainClassOption main, VerboseOption verbose, AdditionalArgumentsOption additionals, JarCommand.FilesOption files)
extends Record
implements Command<JarCommand>
The jar command creates an archive for classes and resources, and manipulates or restores
individual classes or resources from an archive.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
Archive file name option.static final record
Directories and regular files option.static final record
Entry point for standalone applications option.static final record
Main operation mode option. -
Constructor Summary
ConstructorDescriptionJarCommand
(JarCommand.ModeOption mode, JarCommand.FileOption file, JarCommand.MainClassOption main, VerboseOption verbose, AdditionalArgumentsOption additionals, JarCommand.FilesOption files) Creates an instance of aJarCommand
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadditionals
record component.additionals
(AdditionalArgumentsOption additionals) Creates a new instance of the implementing class with the given option object.final boolean
Indicates whether some other object is "equal to" this one.file()
Returns the value of thefile
record component.files()
Returns the value of thefiles
record component.final int
hashCode()
Returns a hash code value for this object.main()
Returns the value of themain
record component.mode()
Returns the value of themode
record component.name()
Returns the name of the command.Creates a new instance of the implementing class with the given option object.Returns a list of all aggregated arguments.final String
toString()
Returns a string representation of this record class.verbose()
Returns the value of theverbose
record component.
-
Constructor Details
-
JarCommand
public JarCommand() -
JarCommand
public JarCommand(JarCommand.ModeOption mode, JarCommand.FileOption file, JarCommand.MainClassOption main, VerboseOption verbose, AdditionalArgumentsOption additionals, JarCommand.FilesOption files) Creates an instance of aJarCommand
record class.- Parameters:
mode
- the value for themode
record componentfile
- the value for thefile
record componentmain
- the value for themain
record componentverbose
- the value for theverbose
record componentadditionals
- the value for theadditionals
record componentfiles
- the value for thefiles
record component
-
-
Method Details
-
name
Description copied from interface:Command
Returns the name of the command.- Specified by:
name
in interfaceCommand<JarCommand>
- Returns:
- the name of the command
-
option
Description copied from interface:Command
Creates a new instance of the implementing class with the given option object.- Specified by:
option
in interfaceCommand<JarCommand>
- Parameters:
option
- the option object to use- Returns:
- a new instance of the implementing class
-
mode
-
file
-
main
-
verbose
-
additionals
Description copied from interface:Command
Creates a new instance of the implementing class with the given option object.- Specified by:
additionals
in interfaceCommand<JarCommand>
- Parameters:
additionals
- the option object to use- Returns:
- a new instance of the implementing class
- See Also:
-
filesAdd
-
filesAdd
-
toArguments
Description copied from interface:Command
Returns a list of all aggregated arguments.- Specified by:
toArguments
in interfaceCommand<JarCommand>
- Returns:
- a list of all aggregated 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
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)
. -
mode
Returns the value of themode
record component.- Returns:
- the value of the
mode
record component
-
file
Returns the value of thefile
record component.- Returns:
- the value of the
file
record component
-
main
Returns the value of themain
record component.- Returns:
- the value of the
main
record component
-
verbose
Returns the value of theverbose
record component.- Returns:
- the value of the
verbose
record component
-
additionals
Returns the value of theadditionals
record component.- Specified by:
additionals
in interfaceCommand<JarCommand>
- Returns:
- the value of the
additionals
record component
-
files
Returns the value of thefiles
record component.- Returns:
- the value of the
files
record component
-