Record Class ModelRunTarget

java.lang.Object
java.lang.Record
dk.gtz.graphedit.model.ModelRunTarget
Record Components:
name - The name of the runtarget
command - The command to run - must be a valid path to an executable
arguments - List of command arguments
cwd - Where to execute the command from
runAsShell - When true, will run the command in a shell
saveBeforeRun - When true, will save the project before running the runtarget
restartAfterRun - When true, will restart the application after the runtarget has been run
environment - Mapping of environment variable assignments

public record ModelRunTarget(String name, String command, List<String> arguments, String cwd, Boolean runAsShell, Boolean saveBeforeRun, Boolean restartAfterRun, Map<String,String> environment) extends Record
Runtarget datastructure. A runtarget is an abstraction over a command-line program call
  • Constructor Details

    • ModelRunTarget

      public ModelRunTarget(String name, String command, List<String> arguments, String cwd, Boolean runAsShell, Boolean saveBeforeRun, Boolean restartAfterRun, Map<String,String> environment)
      Creates an instance of a ModelRunTarget record class.
      Parameters:
      name - the value for the name record component
      command - the value for the command record component
      arguments - the value for the arguments record component
      cwd - the value for the cwd record component
      runAsShell - the value for the runAsShell record component
      saveBeforeRun - the value for the saveBeforeRun record component
      restartAfterRun - the value for the restartAfterRun record component
      environment - the value for the environment record component
  • Method Details

    • 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
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • command

      public String command()
      Returns the value of the command record component.
      Returns:
      the value of the command record component
    • arguments

      public List<String> arguments()
      Returns the value of the arguments record component.
      Returns:
      the value of the arguments record component
    • cwd

      public String cwd()
      Returns the value of the cwd record component.
      Returns:
      the value of the cwd record component
    • runAsShell

      public Boolean runAsShell()
      Returns the value of the runAsShell record component.
      Returns:
      the value of the runAsShell record component
    • saveBeforeRun

      public Boolean saveBeforeRun()
      Returns the value of the saveBeforeRun record component.
      Returns:
      the value of the saveBeforeRun record component
    • restartAfterRun

      public Boolean restartAfterRun()
      Returns the value of the restartAfterRun record component.
      Returns:
      the value of the restartAfterRun record component
    • environment

      public Map<String,String> environment()
      Returns the value of the environment record component.
      Returns:
      the value of the environment record component