Class ApplicationInfo

java.lang.Object
oshi.software.os.ApplicationInfo

public class ApplicationInfo extends Object
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 Details

    • ApplicationInfo

      public ApplicationInfo(String name, String version, String vendor, long timestamp, Map<String,String> additionalInfo)
      Constructs an ApplicationInfo 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 be null, in which case an empty map is used).
  • Method Details

    • getName

      public String getName()
      Gets the name of the installed application.
      Returns:
      The application name, or an empty string if not available.
    • getVersion

      public String getVersion()
      Gets the version of the installed application.
      Returns:
      The application version, or an empty string if not available.
    • getVendor

      public String 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

      public Map<String,String> 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

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object