Record Class Arguments
java.lang.Object
java.lang.Record
org.matwoess.jsourceprofiler.tool.cli.Arguments
- Record Components:
runMode- one ofRunModetargetPath- the path to the main Java file (or directory for instrument-only mode)sourcesDir- the directory with additional Java files to instrumentsyncCounters- whether to instrument using synchronized counter-incrementsverboseOutput- whether to output verbose info about instrumentation of filesprogramArgs- the program arguments to pass to the main method
public record Arguments(org.matwoess.jsourceprofiler.common.RunMode runMode, Path targetPath, Path sourcesDir, boolean syncCounters, boolean verboseOutput, String[] programArgs)
extends Record
Represents the command line arguments for the profiler tool.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.static StringgetUsage()inthashCode()Returns a hash code value for this object.static ArgumentsParses the command line arguments and returns anArgumentsobject.static voidString[]Returns the value of theprogramArgsrecord component.org.matwoess.jsourceprofiler.common.RunModerunMode()Returns the value of therunModerecord component.Returns the value of thesourcesDirrecord component.booleanReturns the value of thesyncCountersrecord component.Returns the value of thetargetPathrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of theverboseOutputrecord component.
-
Constructor Details
-
Arguments
public Arguments(org.matwoess.jsourceprofiler.common.RunMode runMode, Path targetPath, Path sourcesDir, boolean syncCounters, boolean verboseOutput, String[] programArgs) Creates an instance of aArgumentsrecord class.- Parameters:
runMode- the value for therunModerecord componenttargetPath- the value for thetargetPathrecord componentsourcesDir- the value for thesourcesDirrecord componentsyncCounters- the value for thesyncCountersrecord componentverboseOutput- the value for theverboseOutputrecord componentprogramArgs- the value for theprogramArgsrecord component
-
-
Method Details
-
parse
Parses the command line arguments and returns anArgumentsobject.- Parameters:
args- the tool's command line string arguments- Returns:
- the parsed arguments as a record
- Throws:
IllegalArgumentException- if insufficient, too many, or invalid arguments are given
-
printUsage
public static void printUsage() -
getUsage
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
runMode
public org.matwoess.jsourceprofiler.common.RunMode runMode()Returns the value of therunModerecord component.- Returns:
- the value of the
runModerecord component
-
targetPath
Returns the value of thetargetPathrecord component.- Returns:
- the value of the
targetPathrecord component
-
sourcesDir
Returns the value of thesourcesDirrecord component.- Returns:
- the value of the
sourcesDirrecord component
-
syncCounters
public boolean syncCounters()Returns the value of thesyncCountersrecord component.- Returns:
- the value of the
syncCountersrecord component
-
verboseOutput
public boolean verboseOutput()Returns the value of theverboseOutputrecord component.- Returns:
- the value of the
verboseOutputrecord component
-
programArgs
Returns the value of theprogramArgsrecord component.- Returns:
- the value of the
programArgsrecord component
-