APIdia Launch Partner
Top Description Inners Methods
jdk.jpackage.internal.model

public Interface FileAssociation

Known Direct Subinterfaces
jdk.jpackage.internal.DesktopIntegration.LinuxFileAssociation
Known Direct Implementers
jdk.jpackage.internal.model.FileAssociation.Stub
Imports
java.nio.file.Path, java.util.Optional

File association.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static record
FileAssociation.Stub

Default implementation of FileAssociation interface

Method Summary

Modifier and TypeMethod and Description
public Optional<String>

Returns:

file association description
description
()

Returns file association description if available or an empty Optional instance.

public String

Returns:

file association extension
extension
()

Returns file association extension.

public default boolean

Returns:

true if the file association has an icon
hasIcon
()

Returns true if the file association has an icon.

public Optional<Path>

Returns:

file association icon
icon
()

Returns file association icon if available or an empty Optional instance.

public String

Returns:

file association MIME type
mimeType
()

Returns file association MIME type.

Method Detail

descriptionback to summary
public Optional<String> description()

Returns file association description if available or an empty Optional instance.

Returns:Optional<String>

file association description

extensionback to summary
public String extension()

Returns file association extension. E.g.: .txt

Returns:String

file association extension

hasIconback to summary
public default boolean hasIcon()

Returns true if the file association has an icon.

Returns:boolean

true if the file association has an icon

See Also
icon()
iconback to summary
public Optional<Path> icon()

Returns file association icon if available or an empty Optional instance.

Returns:Optional<Path>

file association icon

See Also
hasIcon()
mimeTypeback to summary
public String mimeType()

Returns file association MIME type. E.g.: application/foo, text/plain.

Returns:String

file association MIME type

jdk.jpackage.internal.model back to summary

public final Record FileAssociation.Stub

extends Record
implements FileAssociation
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.model.FileAssociation
Record Components
description:Optional<String> 
icon:Optional<Path> 
mimeType:String 
extension:String 

Default implementation of FileAssociation interface

Field Summary

Modifier and TypeField and Description
private final Optional<String>
description

Record Component accessed by description().

private final String
extension

Record Component accessed by extension().

private final Optional<Path>
icon

Record Component accessed by icon().

private final String
mimeType

Record Component accessed by mimeType().

Constructor Summary

AccessConstructor and Description
public
Stub(Optional<String> description, Optional<Path> icon, String mimeType, String extension)

Method Summary

Modifier and TypeMethod and Description
public Optional<String>
description()

Record Component getter of description.

Implements jdk.jpackage.internal.model.FileAssociation.description.

Returns file association description if available or an empty Optional instance.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public String
extension()

Record Component getter of extension.

Implements jdk.jpackage.internal.model.FileAssociation.extension.

Returns file association extension.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public Optional<Path>
icon()

Record Component getter of icon.

Implements jdk.jpackage.internal.model.FileAssociation.icon.

Returns file association icon if available or an empty Optional instance.

public String
mimeType()

Record Component getter of mimeType.

Implements jdk.jpackage.internal.model.FileAssociation.mimeType.

Returns file association MIME type.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

descriptionback to summary
private final Optional<String> description

Record Component accessed by description().

extensionback to summary
private final String extension

Record Component accessed by extension().

iconback to summary
private final Optional<Path> icon

Record Component accessed by icon().

mimeTypeback to summary
private final String mimeType

Record Component accessed by mimeType().

Constructor Detail

Stubback to summary
public Stub(Optional<String> description, Optional<Path> icon, String mimeType, String extension)

Method Detail

descriptionback to summary
public Optional<String> description()

Record Component getter of description.

Implements jdk.jpackage.internal.model.FileAssociation.description.

Doc from jdk.jpackage.internal.model.FileAssociation.description.

Returns file association description if available or an empty Optional instance.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
extensionback to summary
public String extension()

Record Component getter of extension.

Implements jdk.jpackage.internal.model.FileAssociation.extension.

Doc from jdk.jpackage.internal.model.FileAssociation.extension.

Returns file association extension. E.g.: .txt

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

iconback to summary
public Optional<Path> icon()

Record Component getter of icon.

Implements jdk.jpackage.internal.model.FileAssociation.icon.

Doc from jdk.jpackage.internal.model.FileAssociation.icon.

Returns file association icon if available or an empty Optional instance.

mimeTypeback to summary
public String mimeType()

Record Component getter of mimeType.

Implements jdk.jpackage.internal.model.FileAssociation.mimeType.

Doc from jdk.jpackage.internal.model.FileAssociation.mimeType.

Returns file association MIME type. E.g.: application/foo, text/plain.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.