Class FirmwareStatusInfo

java.lang.Object
org.openhab.core.thing.firmware.FirmwareStatusInfo

@NonNullByDefault public final class FirmwareStatusInfo extends Object
The FirmwareStatusInfo represents the FirmwareStatus of a Thing. If the firmware status is FirmwareStatus.UPDATE_EXECUTABLE then the information object will also provide the thing UID and the version of the latest updatable firmware for the thing.
Author:
Thomas Höfer - Initial contribution, Dimitar Ivanov - Consolidated all the needed information for firmware status events
  • Method Details

    • createUnknownInfo

      public static FirmwareStatusInfo createUnknownInfo(ThingUID thingUID)
      Creates a new FirmwareStatusInfo having {@link FirmwareStatus#UNKNOWN) as firmware status.
      Returns:
      the firmware status info (not null)
    • createUpToDateInfo

      public static FirmwareStatusInfo createUpToDateInfo(ThingUID thingUID)
      Creates a new FirmwareStatusInfo having {@link FirmwareStatus#UP_TO_DATE) as firmware status.
      Returns:
      the firmware status info (not null)
    • createUpdateAvailableInfo

      public static FirmwareStatusInfo createUpdateAvailableInfo(ThingUID thingUID)
      Creates a new FirmwareStatusInfo having {@link FirmwareStatus#UPDATE_AVAILABLE) as firmware status.
      Returns:
      the firmware status info (not null)
    • createUpdateExecutableInfo

      public static FirmwareStatusInfo createUpdateExecutableInfo(ThingUID thingUID, @Nullable String firmwareVersion)
      Creates a new FirmwareStatusInfo having {@link FirmwareStatus#UPDATE_EXECUTBALE) as firmware status. The given firmware version represents the version of the latest updatable firmware for the thing.
      Parameters:
      firmwareVersion - the version of the latest updatable firmware for the thing (must not be null)
      Returns:
      the firmware status info (not null)
    • getFirmwareStatus

      public FirmwareStatus getFirmwareStatus()
      Returns the firmware status.
      Returns:
      the firmware status (not null)
    • getUpdatableFirmwareVersion

      public @Nullable String getUpdatableFirmwareVersion()
      Returns the firmware version of the latest updatable firmware for the thing.
      Returns:
      the firmware version (only set if firmware status is FirmwareStatus.UPDATE_EXECUTABLE)
    • getThingUID

      public ThingUID getThingUID()
      Returns the thing UID.
      Returns:
      the thing UID of the thing, whose status is updated (not null)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object