Package oshi.software.os
Class ApplicationInfo
java.lang.Object
oshi.software.os.ApplicationInfo
Represents common information about an installed application across different operating systems. This class provides
standardized access to essential application details while allowing flexibility for OS-specific fields via an
additional information map.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets additional application details that are OS-specific and not covered by the main fields.getName()
Gets the name of the installed application.long
Gets the last modified or installation time of the application.Gets the vendor or publisher of the installed application.Gets the version of the installed application.int
hashCode()
toString()
-
Constructor Details
-
ApplicationInfo
public ApplicationInfo(String name, String version, String vendor, long timestamp, Map<String, String> additionalInfo) Constructs anApplicationInfo
object with the specified details.- Parameters:
name
- The name of the application.version
- The version of the application.vendor
- The vendor or publisher of the application.timestamp
- The installation or last modified timestamp in milliseconds since epoch.additionalInfo
- A map of additional information (can benull
, in which case an empty map is used).
-
-
Method Details
-
getName
Gets the name of the installed application.- Returns:
- The application name, or an empty string if not available.
-
getVersion
Gets the version of the installed application.- Returns:
- The application version, or an empty string if not available.
-
getVendor
Gets the vendor or publisher of the installed application.- Returns:
- The vendor name, or an empty string if not available.
-
getTimestamp
public long getTimestamp()Gets the last modified or installation time of the application. The timestamp is represented in milliseconds since the Unix epoch (January 1, 1970, UTC).- On Windows, this corresponds to the application's install date. - On Linux, it represents the package's installation or last modified time. - On macOS, it reflects the last modification timestamp of the application bundle.
- Returns:
- The last modified time in epoch milliseconds, or
0
if unavailable.
-
getAdditionalInfo
Gets additional application details that are OS-specific and not covered by the main fields. This map may include attributes like installation location, source, architecture, or other metadata.- Returns:
- A map containing optional key-value pairs of application details.
-
toString
-
equals
-
hashCode
public int hashCode()
-