java.lang.Object
java.lang.Record
one.jpro.platform.file.ExtensionFilter
- Record Components:
description- the textual description for the filterextensions- a list of the accepted file name extensions
public record ExtensionFilter(String description, boolean allowDirectory, List<String> extensions)
extends Record
Creates an
ExtensionFilter with the specified description
and the file name extensions.
File name extension should be specified in the *.<extension>
format.
- Author:
- Besmir Beqiri
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExtensionFilter(String description, boolean allowDirectory, List<String> extensions) Compact constructor forExtensionFilter.ExtensionFilter(String description, String... extension) Constructor forExtensionFilterwith a single extension. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theallowDirectoryrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theextensionsrecord component.static ExtensionFilterfromJavaFXExtensionFilter(javafx.stage.FileChooser.ExtensionFilter extensionFilter) Converts a JavaFXFileChooser.ExtensionFilterto anExtensionFilter.final inthashCode()Returns a hash code value for this object.static ExtensionFilterCreates anExtensionFilterwith the specified description and the file name extensions.static ExtensionFilterCreates anExtensionFilterwith the specified description and the file name extensions.static javafx.stage.FileChooser.ExtensionFiltertoJavaFXExtensionFilter(ExtensionFilter extensionFilter) Converts thisExtensionFilterto a JavaFXFileChooser.ExtensionFilter.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
ANY
-
DIRECTORY
-
-
Constructor Details
-
ExtensionFilter
Compact constructor forExtensionFilter.- Throws:
NullPointerException- if the description or the extensions arenullIllegalArgumentException- if the description or the extensions are empty
-
ExtensionFilter
Constructor forExtensionFilterwith a single extension.- Parameters:
description- the description of the filterextension- the extension to filter- Throws:
NullPointerException- if the description or the extension arenullIllegalArgumentException- if the description or the extension are empty
-
-
Method Details
-
of
Creates anExtensionFilterwith the specified description and the file name extensions.File name extension should be specified in the
*.<extension>format.- Parameters:
description- the textual description for the filterextensions- an array of the accepted file name extensions- Returns:
- the created
ExtensionFilter - Throws:
NullPointerException- if the description or the extensions arenullIllegalArgumentException- if the description or the extensions are empty
-
of
Creates anExtensionFilterwith the specified description and the file name extensions.File name extension should be specified in the
*.<extension>format.- Parameters:
description- the textual description for the filterextensions- an array of the accepted file name extensions- Returns:
- the created
ExtensionFilter - Throws:
NullPointerException- if the description or the extensions arenullIllegalArgumentException- if the description or the extensions are empty
-
toJavaFXExtensionFilter
public static javafx.stage.FileChooser.ExtensionFilter toJavaFXExtensionFilter(ExtensionFilter extensionFilter) Converts thisExtensionFilterto a JavaFXFileChooser.ExtensionFilter.- Returns:
- a corresponding
FileChooser.ExtensionFilterinstance
-
fromJavaFXExtensionFilter
public static ExtensionFilter fromJavaFXExtensionFilter(javafx.stage.FileChooser.ExtensionFilter extensionFilter) Converts a JavaFXFileChooser.ExtensionFilterto anExtensionFilter.- Parameters:
extensionFilter- the JavaFXFileChooser.ExtensionFilterto convert- Returns:
- the corresponding
ExtensionFilterinstance
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
allowDirectory
public boolean allowDirectory()Returns the value of theallowDirectoryrecord component.- Returns:
- the value of the
allowDirectoryrecord component
-
extensions
Returns the value of theextensionsrecord component.- Returns:
- the value of the
extensionsrecord component
-