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
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, String extension) Constructor forExtensionFilterwith a single extension.ExtensionFilter(String description, List<String> extensions) Compact constructor forExtensionFilter. -
Method Summary
Modifier and TypeMethodDescriptionReturns 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 extension.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
-
-
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 extension.File name extension should be specified in the
*.<extension>format.- Parameters:
description- the textual description for the filterextension- the accepted file name extension- Returns:
- the created
ExtensionFilter - Throws:
NullPointerException- if the description or the extension isnullIllegalArgumentException- if the description or the extension is 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. All components in this record class are compared withObjects::equals(Object,Object). -
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
extensions
Returns the value of theextensionsrecord component.- Returns:
- the value of the
extensionsrecord component
-