add missing no-arg constructors (#509)

* FirmwareUpdateProgressInfo
* FirmwareStatusInfo
* FirmwareUpdateResultInfo

Fixes: https://github.com/openhab/openhab-core/issues/507

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
This commit is contained in:
Markus Rathgeb 2019-02-01 13:24:25 +00:00 committed by Kai Kreuzer
parent c37d2a41e9
commit 68c8db8227
3 changed files with 37 additions and 0 deletions

View File

@ -37,6 +37,17 @@ public final class FirmwareStatusInfo {
@Nullable
private final String firmwareVersion;
/**
* Package protected default constructor to allow reflective instantiation.
*
* !!! DO NOT REMOVE - Gson needs it !!!
*/
FirmwareStatusInfo() {
thingUID = new ThingUID("internal:reflective:constructor");
firmwareStatus = FirmwareStatus.UNKNOWN;
firmwareVersion = null;
}
private FirmwareStatusInfo(ThingUID thingUID, FirmwareStatus firmwareStatus, @Nullable String firmwareVersion) {
Objects.requireNonNull(thingUID, "Thing UID must not be null.");
this.thingUID = thingUID;

View File

@ -13,6 +13,7 @@
package org.eclipse.smarthome.core.thing.firmware;
import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
import org.eclipse.jdt.annotation.NonNull;
@ -44,6 +45,20 @@ public final class FirmwareUpdateProgressInfo {
private final @Nullable Integer progress;
/**
* Package protected default constructor to allow reflective instantiation.
*
* !!! DO NOT REMOVE - Gson needs it !!!
*/
FirmwareUpdateProgressInfo() {
thingUID = new ThingUID("internal:reflective:constructor");
firmwareVersion = "";
progressStep = ProgressStep.WAITING;
sequence = Collections.emptyList();
pending = false;
progress = null;
}
private FirmwareUpdateProgressInfo(ThingUID thingUID, String firmwareVersion, ProgressStep progressStep,
Collection<ProgressStep> sequence, boolean pending, int progress) {
Objects.requireNonNull(thingUID, "ThingUID must not be null.");

View File

@ -33,6 +33,17 @@ public final class FirmwareUpdateResultInfo {
private final ThingUID thingUID;
/**
* Package protected default constructor to allow reflective instantiation.
*
* !!! DO NOT REMOVE - Gson needs it !!!
*/
FirmwareUpdateResultInfo() {
thingUID = new ThingUID("internal:reflective:constructor");
result = FirmwareUpdateResult.ERROR;
errorMessage = null;
}
private FirmwareUpdateResultInfo(ThingUID thingUID, FirmwareUpdateResult result, @Nullable String errorMessage) {
Objects.requireNonNull(thingUID, "The thingUID must not be null.");
this.thingUID = thingUID;