Record Class ViewModelRunTarget

java.lang.Object
java.lang.Record
dk.gtz.graphedit.viewmodel.ViewModelRunTarget
Record Components:
name - The name of the runtarget
command - The command to run - must be a valid path to an executable
currentWorkingDirectory - 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
arguments - List of command arguments
environment - List of environment variable assignments

public record ViewModelRunTarget(javafx.beans.property.SimpleStringProperty name, javafx.beans.property.SimpleStringProperty command, javafx.beans.property.SimpleStringProperty currentWorkingDirectory, javafx.beans.property.SimpleBooleanProperty runAsShell, javafx.beans.property.SimpleBooleanProperty saveBeforeRun, javafx.beans.property.SimpleBooleanProperty restartAfterRun, javafx.beans.property.SimpleListProperty<javafx.beans.property.StringProperty> arguments, javafx.beans.property.SimpleListProperty<ViewModelEnvironmentVariable> environment) extends Record
View model representation of a ModelRunTarget.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new viewmodel for runtargets
    ViewModelRunTarget(String name, String command, String currentWorkingDirectory, Boolean runAsShell, Boolean saveBeforeRun, Boolean restartAfterRun, List<String> arguments, Map<String,String> environment)
    Constructs a new viewmodel for runtargets
    ViewModelRunTarget(javafx.beans.property.SimpleStringProperty name, javafx.beans.property.SimpleStringProperty command, javafx.beans.property.SimpleStringProperty currentWorkingDirectory, javafx.beans.property.SimpleBooleanProperty runAsShell, javafx.beans.property.SimpleBooleanProperty saveBeforeRun, javafx.beans.property.SimpleBooleanProperty restartAfterRun, javafx.beans.property.SimpleListProperty<javafx.beans.property.StringProperty> arguments, javafx.beans.property.SimpleListProperty<ViewModelEnvironmentVariable> environment)
    Creates an instance of a ViewModelRunTarget record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    javafx.beans.property.SimpleListProperty<javafx.beans.property.StringProperty>
    Returns the value of the arguments record component.
    javafx.beans.property.SimpleStringProperty
    Returns the value of the command record component.
    javafx.beans.property.SimpleStringProperty
    Returns the value of the currentWorkingDirectory record component.
    javafx.beans.property.SimpleListProperty<ViewModelEnvironmentVariable>
    Returns the value of the environment record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    javafx.beans.property.SimpleStringProperty
    Returns the value of the name record component.
    javafx.beans.property.SimpleBooleanProperty
    Returns the value of the restartAfterRun record component.
    javafx.beans.property.SimpleBooleanProperty
    Returns the value of the runAsShell record component.
    javafx.beans.property.SimpleBooleanProperty
    Returns the value of the saveBeforeRun record component.
    Converts this viewmodel into a model type
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ViewModelRunTarget

      public ViewModelRunTarget(String name, String command, String currentWorkingDirectory, Boolean runAsShell, Boolean saveBeforeRun, Boolean restartAfterRun, List<String> arguments, Map<String,String> environment)
      Constructs a new viewmodel for runtargets
      Parameters:
      name - The name of the runtarget
      command - The command to run - must be a valid path to an executable
      currentWorkingDirectory - 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
      arguments - List of command arguments
      environment - List of environment variable assignments
    • ViewModelRunTarget

      public ViewModelRunTarget(ModelRunTarget runTarget)
      Constructs a new viewmodel for runtargets
      Parameters:
      runTarget - The model equivalent runtarget
    • ViewModelRunTarget

      public ViewModelRunTarget(javafx.beans.property.SimpleStringProperty name, javafx.beans.property.SimpleStringProperty command, javafx.beans.property.SimpleStringProperty currentWorkingDirectory, javafx.beans.property.SimpleBooleanProperty runAsShell, javafx.beans.property.SimpleBooleanProperty saveBeforeRun, javafx.beans.property.SimpleBooleanProperty restartAfterRun, javafx.beans.property.SimpleListProperty<javafx.beans.property.StringProperty> arguments, javafx.beans.property.SimpleListProperty<ViewModelEnvironmentVariable> environment)
      Creates an instance of a ViewModelRunTarget record class.
      Parameters:
      name - the value for the name record component
      command - the value for the command record component
      currentWorkingDirectory - the value for the currentWorkingDirectory 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
      arguments - the value for the arguments record component
      environment - the value for the environment record component
  • Method Details

    • toModel

      public ModelRunTarget toModel()
      Converts this viewmodel into a model type
      Returns:
      A model version of this runtarget data
    • 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 javafx.beans.property.SimpleStringProperty name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • command

      public javafx.beans.property.SimpleStringProperty command()
      Returns the value of the command record component.
      Returns:
      the value of the command record component
    • currentWorkingDirectory

      public javafx.beans.property.SimpleStringProperty currentWorkingDirectory()
      Returns the value of the currentWorkingDirectory record component.
      Returns:
      the value of the currentWorkingDirectory record component
    • runAsShell

      public javafx.beans.property.SimpleBooleanProperty runAsShell()
      Returns the value of the runAsShell record component.
      Returns:
      the value of the runAsShell record component
    • saveBeforeRun

      public javafx.beans.property.SimpleBooleanProperty saveBeforeRun()
      Returns the value of the saveBeforeRun record component.
      Returns:
      the value of the saveBeforeRun record component
    • restartAfterRun

      public javafx.beans.property.SimpleBooleanProperty restartAfterRun()
      Returns the value of the restartAfterRun record component.
      Returns:
      the value of the restartAfterRun record component
    • arguments

      public javafx.beans.property.SimpleListProperty<javafx.beans.property.StringProperty> arguments()
      Returns the value of the arguments record component.
      Returns:
      the value of the arguments record component
    • environment

      public javafx.beans.property.SimpleListProperty<ViewModelEnvironmentVariable> environment()
      Returns the value of the environment record component.
      Returns:
      the value of the environment record component