Package dk.gtz.graphedit.viewmodel
Record Class ViewModelProject
java.lang.Object
java.lang.Record
dk.gtz.graphedit.viewmodel.ViewModelProject
- Record Components:
metadata- A map of generic string-encoded metadata, useful for syntax=specific dataname- The name of the projectrootDirectory- The directory containing the on-disk fileisSavedInTemp- Whether or not the project is currently a temporary projectexcludeFiles- A list of files to exclude from the project, can be glob-specificationsrunTargets- A list ofViewModelRunTargetassociated with this project
public record ViewModelProject(javafx.beans.property.SimpleListProperty<javafx.util.Pair<javafx.beans.property.StringProperty,javafx.beans.property.StringProperty>> metadata, javafx.beans.property.SimpleStringProperty name, javafx.beans.property.SimpleStringProperty rootDirectory, javafx.beans.property.SimpleBooleanProperty isSavedInTemp, javafx.beans.property.SimpleListProperty<javafx.beans.property.StringProperty> excludeFiles, javafx.beans.property.SimpleListProperty<ViewModelRunTarget> runTargets)
extends Record
Viewmodel version of the on-disk file structure for a project file
Not to be confused with
ViewModelProjectResource, this class represents a graphedit project.-
Constructor Summary
ConstructorsConstructorDescriptionViewModelProject(ModelProject modelProject) Constructs a new temporary viewmodel project based on a model instanceViewModelProject(ModelProject modelProject, Optional<String> rootDirectory) Constructs a new viewmodel project based on a model instance and an optional rootdirectoryViewModelProject(javafx.beans.property.SimpleListProperty<javafx.util.Pair<javafx.beans.property.StringProperty, javafx.beans.property.StringProperty>> metadata, javafx.beans.property.SimpleStringProperty name, javafx.beans.property.SimpleStringProperty rootDirectory, javafx.beans.property.SimpleBooleanProperty isSavedInTemp, javafx.beans.property.SimpleListProperty<javafx.beans.property.StringProperty> excludeFiles, javafx.beans.property.SimpleListProperty<ViewModelRunTarget> runTargets) Creates an instance of aViewModelProjectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.javafx.beans.property.SimpleListProperty<javafx.beans.property.StringProperty>Returns the value of theexcludeFilesrecord component.final inthashCode()Returns a hash code value for this object.javafx.beans.property.SimpleBooleanPropertyReturns the value of theisSavedInTemprecord component.javafx.beans.property.SimpleListProperty<javafx.util.Pair<javafx.beans.property.StringProperty,javafx.beans.property.StringProperty>> metadata()Returns the value of themetadatarecord component.javafx.beans.property.SimpleStringPropertyname()Returns the value of thenamerecord component.javafx.beans.property.SimpleStringPropertyReturns the value of therootDirectoryrecord component.javafx.beans.property.SimpleListProperty<ViewModelRunTarget>Returns the value of therunTargetsrecord component.toModel()Converts this viewmodel into a model typefinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ViewModelProject
Constructs a new temporary viewmodel project based on a model instance- Parameters:
modelProject- The model project datastructure to base on- Throws:
IOException- when temporary directory creation failed
-
ViewModelProject
public ViewModelProject(ModelProject modelProject, Optional<String> rootDirectory) throws IOException Constructs a new viewmodel project based on a model instance and an optional rootdirectory- Parameters:
modelProject- The model project datastructure to base onrootDirectory- When provided, a valid file path containing the associated model project file, else will create a new temp directory for you- Throws:
IOException- when temporary directory creation failed
-
ViewModelProject
public ViewModelProject(javafx.beans.property.SimpleListProperty<javafx.util.Pair<javafx.beans.property.StringProperty, javafx.beans.property.StringProperty>> metadata, javafx.beans.property.SimpleStringProperty name, javafx.beans.property.SimpleStringProperty rootDirectory, javafx.beans.property.SimpleBooleanProperty isSavedInTemp, javafx.beans.property.SimpleListProperty<javafx.beans.property.StringProperty> excludeFiles, javafx.beans.property.SimpleListProperty<ViewModelRunTarget> runTargets) Creates an instance of aViewModelProjectrecord class.- Parameters:
metadata- the value for themetadatarecord componentname- the value for thenamerecord componentrootDirectory- the value for therootDirectoryrecord componentisSavedInTemp- the value for theisSavedInTemprecord componentexcludeFiles- the value for theexcludeFilesrecord componentrunTargets- the value for therunTargetsrecord component
-
-
Method Details
-
toModel
Converts this viewmodel into a model type- Returns:
- A model version of this project 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). -
metadata
public javafx.beans.property.SimpleListProperty<javafx.util.Pair<javafx.beans.property.StringProperty,javafx.beans.property.StringProperty>> metadata()Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-
name
public javafx.beans.property.SimpleStringProperty name()Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
rootDirectory
public javafx.beans.property.SimpleStringProperty rootDirectory()Returns the value of therootDirectoryrecord component.- Returns:
- the value of the
rootDirectoryrecord component
-
isSavedInTemp
public javafx.beans.property.SimpleBooleanProperty isSavedInTemp()Returns the value of theisSavedInTemprecord component.- Returns:
- the value of the
isSavedInTemprecord component
-
excludeFiles
public javafx.beans.property.SimpleListProperty<javafx.beans.property.StringProperty> excludeFiles()Returns the value of theexcludeFilesrecord component.- Returns:
- the value of the
excludeFilesrecord component
-
runTargets
Returns the value of therunTargetsrecord component.- Returns:
- the value of the
runTargetsrecord component
-