Class FirmwareUpdateProgressInfo


  • @NonNullByDefault
    public final class FirmwareUpdateProgressInfo
    extends Object
    The FirmwareUpdateProgressInfo represents the progress indicator for a firmware update.
    Author:
    Thomas Höfer - Initial contribution, Christoph Knauf - Added progress and pending, Dimitar Ivanov - Consolidated all the needed information for firmware status events
    • Method Detail

      • createFirmwareUpdateProgressInfo

        public static FirmwareUpdateProgressInfo createFirmwareUpdateProgressInfo​(ThingUID thingUID,
                                                                                  String firmwareVersion,
                                                                                  ProgressStep progressStep,
                                                                                  Collection<ProgressStep> sequence,
                                                                                  boolean pending,
                                                                                  int progress)
        Parameters:
        thingUID - the thing UID of the thing that is updated (must not be null)
        firmwareVersion - the version of the firmware that is updated (must not be null)
        progressStep - the current progress step (must not be null)
        sequence - the collection of progress steps describing the sequence of the firmware update process (must not be null)
        pending - the flag indicating if the update is pending
        progress - the progress of the update in percent
        Returns:
        FirmwareUpdateProgressInfo object (not null)
        Throws:
        IllegalArgumentException - if sequence is null or empty or progress is not between 0 and 100
      • createFirmwareUpdateProgressInfo

        public static FirmwareUpdateProgressInfo createFirmwareUpdateProgressInfo​(ThingUID thingUID,
                                                                                  ThingTypeUID thingTypeUID,
                                                                                  String firmwareVersion,
                                                                                  ProgressStep progressStep,
                                                                                  Collection<ProgressStep> sequence,
                                                                                  boolean pending)
        Parameters:
        thingUID - the thing UID of the thing that is updated (must not be null)
        firmwareVersion - the version of the firmware that is updated (must not be null)
        progressStep - the current progress step (must not be null)
        sequence - the collection of progress steps describing the sequence of the firmware update process (must not be null)
        pending - the flag indicating if the update is pending
        Returns:
        FirmwareUpdateProgressInfo object (not null)
        Throws:
        IllegalArgumentException - if sequence is null or empty
      • getFirmwareVersion

        public String getFirmwareVersion()
        Returns the firmware version of the firmware that is updated.
        Returns:
        the firmware version of the firmware that is updated (not null)
      • getProgressStep

        public ProgressStep getProgressStep()
        Returns the current progress step.
        Returns:
        the current progress step (not null)
      • getSequence

        public Collection<ProgressStep> getSequence()
        Returns the sequence of the firmware update process.
        Returns:
        the sequence (not null)
      • isPending

        public boolean isPending()
        Returns true if the firmware update is pending, false otherwise
        Returns:
        true if pending, false otherwise
      • getProgress

        public @Nullable Integer getProgress()
        Returns the percentage progress of the firmware update.
        Returns:
        the progress between 0 and 100 or null if no progress was set
      • getThingUID

        public ThingUID getThingUID()
        Returns the thing UID.
        Returns:
        the thing UID
      • hashCode

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

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