Feature extend system management resource with custom data (#423)

* Added map to system management and mgmt resource to extend the the rest resource with custom data

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Lazy initialization of hash map and typo fix

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Renamed the map to usageData

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Adapted hashcode and equals and now returning empty map

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Reduced duplicated code

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Removed the if statement

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Added separated method for lazy initialization 

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>
This commit is contained in:
Jonathan Knoblauch
2017-01-27 16:42:25 +01:00
committed by Michael Hirsch
parent a00ea49e47
commit d553716cda
3 changed files with 51 additions and 38 deletions

View File

@@ -8,6 +8,8 @@
*/
package org.eclipse.hawkbit.mgmt.json.model.systemmanagement;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
@@ -25,6 +27,7 @@ public class MgmtSystemTenantServiceUsage {
private long artifacts;
private long actions;
private long overallArtifactVolumeInBytes;
private Map<String, String> usageData;
/**
* Constructor.
@@ -71,4 +74,12 @@ public class MgmtSystemTenantServiceUsage {
return tenantName;
}
public Map<String, String> getUsageData() {
return usageData;
}
public void setUsageData(final Map<String, String> usageData) {
this.usageData = usageData;
}
}