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

public Interface Launcher

Known Direct Subinterfaces
jdk.jpackage.internal.model.LinuxLauncher
Known Direct Implementers
jdk.jpackage.internal.model.Launcher.Stub
Imports
java.io.InputStream, java.util.List, .Map, .Optional, jdk.jpackage.internal.resources.ResourceLocator

Application launcher.
See Also
Application#launchers()

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static record
Launcher.Stub

Default implementation of Launcher interface.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the key in the resource bundle referring to the default launcher icon
defaultIconResourceName
()

Gets key in the resource bundle of jdk.jpackage/ module referring to the default launcher icon.

public String

Returns:

the description of this launcher
description
()

Gets the description of this launcher.

public default String

Returns:

the name of the executable file of this launcher
executableName
()

Gets the name of the executable file of this launcher without file extension.

public default String

Returns:

the full name of the executable file of this launcher
executableNameWithSuffix
()

Gets the full name of the executable file of this launcher.

public default InputStream

Returns:

a stream with the template executable file for this launcher
executableResource
()

Opens a stream with the template executable file for this launcher.

public default Optional<String>

Returns:

the extension of the executable file of this launcher
executableSuffix
()

Gets extension of the executable file of this launcher if available or an empty Optional instance otherwise.

public Map<String, String>

Returns:

the additional properties for application launcher entries in ".jpackage.xml" file
extraAppImageFileData
()

Gets the additional properties for application launcher entries in the app image (".jpackage.xml") file.

public List<FileAssociation>

Returns:

the file associations of this launcher
fileAssociations
()

Gets the file associations of this launcher.

public default boolean

Returns:

true if this launcher has non-default icon
hasCustomIcon
()

Returns true if this launcher has non-default icon.

public default boolean

Returns:

true if this launcher has a default icon
hasDefaultIcon
()

Returns true if this launcher has a default icon.

public default boolean

Returns:

true if this launcher is requested to have an icon
hasIcon
()

Returns true if this launcher is requested to have an icon.

public Optional<LauncherIcon>

Returns:

the icon for this launcher
icon
()

Gets the icon for this launcher or an empty Optional instance if the launcher is requested to have no icon.

public boolean

Returns:

true if this launcher should be installed as a service
isService
()

Returns true if this launcher should be installed as a service.

public String

Returns:

the name of this launcher
name
()

Gets the name of this launcher.

public Optional<LauncherStartupInfo>

Returns:

the startup information of this launcher
startupInfo
()

Gets the startup information of this launcher if available or an empty Optional instance otherwise.

Method Detail

defaultIconResourceNameback to summary
public String defaultIconResourceName()

Gets key in the resource bundle of jdk.jpackage/ module referring to the default launcher icon.

Returns:String

the key in the resource bundle referring to the default launcher icon

descriptionback to summary
public String description()

Gets the description of this launcher.

Returns:String

the description of this launcher

executableNameback to summary
public default String executableName()

Gets the name of the executable file of this launcher without file extension.

Returns:String

the name of the executable file of this launcher

executableNameWithSuffixback to summary
public default String executableNameWithSuffix()

Gets the full name of the executable file of this launcher. The full name consists of the name and the extension.

Returns:String

the full name of the executable file of this launcher

executableResourceback to summary
public default InputStream executableResource()

Opens a stream with the template executable file for this launcher. Caller is responsible for close the stream.

Returns:InputStream

a stream with the template executable file for this launcher

executableSuffixback to summary
public default Optional<String> executableSuffix()

Gets extension of the executable file of this launcher if available or an empty Optional instance otherwise.

Returns:Optional<String>

the extension of the executable file of this launcher

extraAppImageFileDataback to summary
public Map<String, String> extraAppImageFileData()

Gets the additional properties for application launcher entries in the app image (".jpackage.xml") file.

Returns:Map<String, String>

the additional properties for application launcher entries in ".jpackage.xml" file

fileAssociationsback to summary
public List<FileAssociation> fileAssociations()

Gets the file associations of this launcher.

Returns:List<FileAssociation>

the file associations of this launcher

hasCustomIconback to summary
public default boolean hasCustomIcon()

Returns true if this launcher has non-default icon.

A custom icon can be sourced from an external file or from the resource directory.

Returns:boolean

true if this launcher has non-default icon

See Also
CustomLauncherIcon, icon(), hasDefaultIcon(), hasIcon()
hasDefaultIconback to summary
public default boolean hasDefaultIcon()

Returns true if this launcher has a default icon.

Returns:boolean

true if this launcher has a default icon

See Also
DefaultLauncherIcon, icon(), hasIcon(), hasCustomIcon()
hasIconback to summary
public default boolean hasIcon()

Returns true if this launcher is requested to have an icon.

Returns:boolean

true if this launcher is requested to have an icon

See Also
icon(), hasDefaultIcon(), hasCustomIcon()
iconback to summary
public Optional<LauncherIcon> icon()

Gets the icon for this launcher or an empty Optional instance if the launcher is requested to have no icon.

Returns:Optional<LauncherIcon>

the icon for this launcher

See Also
hasIcon(), hasDefaultIcon(), hasCustomIcon()
isServiceback to summary
public boolean isService()

Returns true if this launcher should be installed as a service.

Returns:boolean

true if this launcher should be installed as a service

nameback to summary
public String name()

Gets the name of this launcher.

Returns:String

the name of this launcher

startupInfoback to summary
public Optional<LauncherStartupInfo> startupInfo()

Gets the startup information of this launcher if available or an empty Optional instance otherwise.

API Note

Launchers from an external application image may not have startup information.

Returns:Optional<LauncherStartupInfo>

the startup information of this launcher

jdk.jpackage.internal.model back to summary

public final Record Launcher.Stub

extends Record
implements Launcher
Class Inheritance
All Implemented Interfaces
jdk.jpackage.internal.model.Launcher
Record Components
name:String 
startupInfo:Optional<LauncherStartupInfo> 
fileAssociations:List<FileAssociation> 
isService:boolean 
description:String 
icon:Optional<LauncherIcon> 
defaultIconResourceName:String 
extraAppImageFileData:Map<String, String> 

Default implementation of Launcher interface.

Field Summary

Modifier and TypeField and Description
private final String
private final String
description

Record Component accessed by description().

private final Map<String, String>
extraAppImageFileData

Record Component accessed by extraAppImageFileData().

private final List<FileAssociation>
fileAssociations

Record Component accessed by fileAssociations().

private final Optional<LauncherIcon>
icon

Record Component accessed by icon().

private final boolean
isService

Record Component accessed by isService().

private final String
name

Record Component accessed by name().

private final Optional<LauncherStartupInfo>
startupInfo

Record Component accessed by startupInfo().

Constructor Summary

AccessConstructor and Description
public
Stub(String name, Optional<LauncherStartupInfo> startupInfo, List<FileAssociation> fileAssociations, boolean isService, String description, Optional<LauncherIcon> icon, String defaultIconResourceName, Map<String, String> extraAppImageFileData)

Method Summary

Modifier and TypeMethod and Description
public String
defaultIconResourceName()

Record Component getter of defaultIconResourceName.

Implements jdk.jpackage.internal.model.Launcher.defaultIconResourceName.

Gets key in the resource bundle of jdk.jpackage/ module referring to the default launcher icon.

public String
description()

Record Component getter of description.

Implements jdk.jpackage.internal.model.Launcher.description.

Gets the description of this launcher.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

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

public Map<String, String>
extraAppImageFileData()

Record Component getter of extraAppImageFileData.

Implements jdk.jpackage.internal.model.Launcher.extraAppImageFileData.

Gets the additional properties for application launcher entries in the app image (".jpackage.xml") file.

public List<FileAssociation>
fileAssociations()

Record Component getter of fileAssociations.

Implements jdk.jpackage.internal.model.Launcher.fileAssociations.

Gets the file associations of this launcher.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public Optional<LauncherIcon>
icon()

Record Component getter of icon.

Implements jdk.jpackage.internal.model.Launcher.icon.

Gets the icon for this launcher or an empty Optional instance if the launcher is requested to have no icon.

public boolean
isService()

Record Component getter of isService.

Implements jdk.jpackage.internal.model.Launcher.isService.

Returns true if this launcher should be installed as a service.

public String
name()

Record Component getter of name.

Implements jdk.jpackage.internal.model.Launcher.name.

Gets the name of this launcher.

public Optional<LauncherStartupInfo>
startupInfo()

Record Component getter of startupInfo.

Implements jdk.jpackage.internal.model.Launcher.startupInfo.

Gets the startup information of this launcher if available or an empty Optional instance otherwise.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

defaultIconResourceNameback to summary
private final String defaultIconResourceName

Record Component accessed by defaultIconResourceName().

descriptionback to summary
private final String description

Record Component accessed by description().

extraAppImageFileDataback to summary
private final Map<String, String> extraAppImageFileData

Record Component accessed by extraAppImageFileData().

fileAssociationsback to summary
private final List<FileAssociation> fileAssociations

Record Component accessed by fileAssociations().

iconback to summary
private final Optional<LauncherIcon> icon

Record Component accessed by icon().

isServiceback to summary
private final boolean isService

Record Component accessed by isService().

nameback to summary
private final String name

Record Component accessed by name().

startupInfoback to summary
private final Optional<LauncherStartupInfo> startupInfo

Record Component accessed by startupInfo().

Constructor Detail

Stubback to summary
public Stub(String name, Optional<LauncherStartupInfo> startupInfo, List<FileAssociation> fileAssociations, boolean isService, String description, Optional<LauncherIcon> icon, String defaultIconResourceName, Map<String, String> extraAppImageFileData)

Method Detail

defaultIconResourceNameback to summary
public String defaultIconResourceName()

Record Component getter of defaultIconResourceName.

Implements jdk.jpackage.internal.model.Launcher.defaultIconResourceName.

Doc from jdk.jpackage.internal.model.Launcher.defaultIconResourceName.

Gets key in the resource bundle of jdk.jpackage/ module referring to the default launcher icon.

descriptionback to summary
public String description()

Record Component getter of description.

Implements jdk.jpackage.internal.model.Launcher.description.

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

Gets the description of this launcher.

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).
extraAppImageFileDataback to summary
public Map<String, String> extraAppImageFileData()

Record Component getter of extraAppImageFileData.

Implements jdk.jpackage.internal.model.Launcher.extraAppImageFileData.

Doc from jdk.jpackage.internal.model.Launcher.extraAppImageFileData.

Gets the additional properties for application launcher entries in the app image (".jpackage.xml") file.

fileAssociationsback to summary
public List<FileAssociation> fileAssociations()

Record Component getter of fileAssociations.

Implements jdk.jpackage.internal.model.Launcher.fileAssociations.

Doc from jdk.jpackage.internal.model.Launcher.fileAssociations.

Gets the file associations of this launcher.

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<LauncherIcon> icon()

Record Component getter of icon.

Implements jdk.jpackage.internal.model.Launcher.icon.

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

Gets the icon for this launcher or an empty Optional instance if the launcher is requested to have no icon.

isServiceback to summary
public boolean isService()

Record Component getter of isService.

Implements jdk.jpackage.internal.model.Launcher.isService.

Doc from jdk.jpackage.internal.model.Launcher.isService.

Returns true if this launcher should be installed as a service.

nameback to summary
public String name()

Record Component getter of name.

Implements jdk.jpackage.internal.model.Launcher.name.

Doc from jdk.jpackage.internal.model.Launcher.name.

Gets the name of this launcher.

startupInfoback to summary
public Optional<LauncherStartupInfo> startupInfo()

Record Component getter of startupInfo.

Implements jdk.jpackage.internal.model.Launcher.startupInfo.

Doc from jdk.jpackage.internal.model.Launcher.startupInfo.

Gets the startup information of this launcher if available or an empty Optional instance otherwise.

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.