Package dk.gtz.graphedit.viewmodel
Record Class ViewModelRunTarget
java.lang.Object
java.lang.Record
dk.gtz.graphedit.viewmodel.ViewModelRunTarget
- Record Components:
name
- The name of the runtargetcommand
- The command to run - must be a valid path to an executablecurrentWorkingDirectory
- Where to execute the command fromrunAsShell
- When true, will run the command in a shellsaveBeforeRun
- When true, will save the project before running the runtargetrestartAfterRun
- When true, will restart the application after the runtarget has been runarguments
- List of command argumentsenvironment
- 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
ConstructorsConstructorDescriptionViewModelRunTarget
(ModelRunTarget runTarget) Constructs a new viewmodel for runtargetsViewModelRunTarget
(String name, String command, String currentWorkingDirectory, Boolean runAsShell, Boolean saveBeforeRun, Boolean restartAfterRun, List<String> arguments, Map<String, String> environment) Constructs a new viewmodel for runtargetsViewModelRunTarget
(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 aViewModelRunTarget
record class. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.SimpleListProperty<javafx.beans.property.StringProperty>
Returns the value of thearguments
record component.javafx.beans.property.SimpleStringProperty
command()
Returns the value of thecommand
record component.javafx.beans.property.SimpleStringProperty
Returns the value of thecurrentWorkingDirectory
record component.javafx.beans.property.SimpleListProperty<ViewModelEnvironmentVariable>
Returns the value of theenvironment
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.javafx.beans.property.SimpleStringProperty
name()
Returns the value of thename
record component.javafx.beans.property.SimpleBooleanProperty
Returns the value of therestartAfterRun
record component.javafx.beans.property.SimpleBooleanProperty
Returns the value of therunAsShell
record component.javafx.beans.property.SimpleBooleanProperty
Returns the value of thesaveBeforeRun
record component.toModel()
Converts this viewmodel into a model typefinal String
toString()
Returns a string representation of this record class.
-
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 runtargetcommand
- The command to run - must be a valid path to an executablecurrentWorkingDirectory
- Where to execute the command fromrunAsShell
- When true, will run the command in a shellsaveBeforeRun
- When true, will save the project before running the runtargetrestartAfterRun
- When true, will restart the application after the runtarget has been runarguments
- List of command argumentsenvironment
- List of environment variable assignments
-
ViewModelRunTarget
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 aViewModelRunTarget
record class.- Parameters:
name
- the value for thename
record componentcommand
- the value for thecommand
record componentcurrentWorkingDirectory
- the value for thecurrentWorkingDirectory
record componentrunAsShell
- the value for therunAsShell
record componentsaveBeforeRun
- the value for thesaveBeforeRun
record componentrestartAfterRun
- the value for therestartAfterRun
record componentarguments
- the value for thearguments
record componentenvironment
- the value for theenvironment
record component
-
-
Method Details
-
toModel
Converts this viewmodel into a model type- Returns:
- A model version of this runtarget data
-
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
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. -
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)
. -
name
public javafx.beans.property.SimpleStringProperty name()Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
command
public javafx.beans.property.SimpleStringProperty command()Returns the value of thecommand
record component.- Returns:
- the value of the
command
record component
-
currentWorkingDirectory
public javafx.beans.property.SimpleStringProperty currentWorkingDirectory()Returns the value of thecurrentWorkingDirectory
record component.- Returns:
- the value of the
currentWorkingDirectory
record component
-
runAsShell
public javafx.beans.property.SimpleBooleanProperty runAsShell()Returns the value of therunAsShell
record component.- Returns:
- the value of the
runAsShell
record component
-
saveBeforeRun
public javafx.beans.property.SimpleBooleanProperty saveBeforeRun()Returns the value of thesaveBeforeRun
record component.- Returns:
- the value of the
saveBeforeRun
record component
-
restartAfterRun
public javafx.beans.property.SimpleBooleanProperty restartAfterRun()Returns the value of therestartAfterRun
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 thearguments
record component.- Returns:
- the value of the
arguments
record component
-
environment
Returns the value of theenvironment
record component.- Returns:
- the value of the
environment
record component
-