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 aViewModelRunTargetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.SimpleListProperty<javafx.beans.property.StringProperty>Returns the value of theargumentsrecord component.javafx.beans.property.SimpleStringPropertycommand()Returns the value of thecommandrecord component.javafx.beans.property.SimpleStringPropertyReturns the value of thecurrentWorkingDirectoryrecord component.javafx.beans.property.SimpleListProperty<ViewModelEnvironmentVariable>Returns the value of theenvironmentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.javafx.beans.property.SimpleStringPropertyname()Returns the value of thenamerecord component.javafx.beans.property.SimpleBooleanPropertyReturns the value of therestartAfterRunrecord component.javafx.beans.property.SimpleBooleanPropertyReturns the value of therunAsShellrecord component.javafx.beans.property.SimpleBooleanPropertyReturns the value of thesaveBeforeRunrecord component.toModel()Converts this viewmodel into a model typefinal StringtoString()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 aViewModelRunTargetrecord class.- Parameters:
name- the value for thenamerecord componentcommand- the value for thecommandrecord componentcurrentWorkingDirectory- the value for thecurrentWorkingDirectoryrecord componentrunAsShell- the value for therunAsShellrecord componentsaveBeforeRun- the value for thesaveBeforeRunrecord componentrestartAfterRun- the value for therestartAfterRunrecord componentarguments- the value for theargumentsrecord componentenvironment- the value for theenvironmentrecord 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 thenamerecord component.- Returns:
- the value of the
namerecord component
-
command
public javafx.beans.property.SimpleStringProperty command()Returns the value of thecommandrecord component.- Returns:
- the value of the
commandrecord component
-
currentWorkingDirectory
public javafx.beans.property.SimpleStringProperty currentWorkingDirectory()Returns the value of thecurrentWorkingDirectoryrecord component.- Returns:
- the value of the
currentWorkingDirectoryrecord component
-
runAsShell
public javafx.beans.property.SimpleBooleanProperty runAsShell()Returns the value of therunAsShellrecord component.- Returns:
- the value of the
runAsShellrecord component
-
saveBeforeRun
public javafx.beans.property.SimpleBooleanProperty saveBeforeRun()Returns the value of thesaveBeforeRunrecord component.- Returns:
- the value of the
saveBeforeRunrecord component
-
restartAfterRun
public javafx.beans.property.SimpleBooleanProperty restartAfterRun()Returns the value of therestartAfterRunrecord component.- Returns:
- the value of the
restartAfterRunrecord component
-
arguments
public javafx.beans.property.SimpleListProperty<javafx.beans.property.StringProperty> arguments()Returns the value of theargumentsrecord component.- Returns:
- the value of the
argumentsrecord component
-
environment
Returns the value of theenvironmentrecord component.- Returns:
- the value of the
environmentrecord component
-