java.lang.Object
java.lang.Record
org.matwoess.jsourceprofiler.tool.cli.Arguments
Record Components:
runMode - one of RunMode
targetPath - the path to the main Java file (or directory for instrument-only mode)
sourcesDir - the directory with additional Java files to instrument
syncCounters - whether to instrument using synchronized counter-increments
verboseOutput - whether to output verbose info about instrumentation of files
programArgs - 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 Details

    • Arguments

      public Arguments(org.matwoess.jsourceprofiler.common.RunMode runMode, Path targetPath, Path sourcesDir, boolean syncCounters, boolean verboseOutput, String[] programArgs)
      Creates an instance of a Arguments record class.
      Parameters:
      runMode - the value for the runMode record component
      targetPath - the value for the targetPath record component
      sourcesDir - the value for the sourcesDir record component
      syncCounters - the value for the syncCounters record component
      verboseOutput - the value for the verboseOutput record component
      programArgs - the value for the programArgs record component
  • Method Details

    • parse

      public static Arguments parse(String[] args) throws IllegalArgumentException
      Parses the command line arguments and returns an Arguments object.
      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

      public static String getUsage()
    • equals

      public boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • runMode

      public org.matwoess.jsourceprofiler.common.RunMode runMode()
      Returns the value of the runMode record component.
      Returns:
      the value of the runMode record component
    • targetPath

      public Path targetPath()
      Returns the value of the targetPath record component.
      Returns:
      the value of the targetPath record component
    • sourcesDir

      public Path sourcesDir()
      Returns the value of the sourcesDir record component.
      Returns:
      the value of the sourcesDir record component
    • syncCounters

      public boolean syncCounters()
      Returns the value of the syncCounters record component.
      Returns:
      the value of the syncCounters record component
    • verboseOutput

      public boolean verboseOutput()
      Returns the value of the verboseOutput record component.
      Returns:
      the value of the verboseOutput record component
    • programArgs

      public String[] programArgs()
      Returns the value of the programArgs record component.
      Returns:
      the value of the programArgs record component