Minor code improvements

Signed-off-by: Dominic Schabel dominic.schabel@bosch-si.com
This commit is contained in:
Dominic Schabel
2016-08-15 11:30:21 +02:00
parent 7f156f05a4
commit 3accac9ade
50 changed files with 639 additions and 696 deletions

View File

@@ -20,18 +20,18 @@ import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
public class AbstractPropertyChangeEvent<E extends TenantAwareBaseEntity> extends AbstractBaseEntityEvent<E> {
private static final long serialVersionUID = -3671601415138242311L;
private final transient Map<String, Values> changeSet;
private final transient Map<String, PropertyChange> changeSet;
/**
* Initialize base entity and property changed with old and new value.
*
*
* @param baseEntity
* entity changed
* @param changeSetValues
* details of properties changed and old value and new value of
* the changed properties
*/
public AbstractPropertyChangeEvent(final E baseEntity, final Map<String, Values> changeSetValues) {
public AbstractPropertyChangeEvent(final E baseEntity, final Map<String, PropertyChange> changeSetValues) {
super(baseEntity);
this.changeSet = changeSetValues;
}
@@ -39,27 +39,27 @@ public class AbstractPropertyChangeEvent<E extends TenantAwareBaseEntity> extend
/**
* @return the changeSet
*/
public Map<String, Values> getChangeSet() {
public Map<String, PropertyChange> getChangeSet() {
return changeSet;
}
/**
* Carries old value and new value of a property .
*
*/
public class Values {
public static class PropertyChange {
private final Object oldValue;
private final Object newValue;
/**
* Initialize old value and new changes value of property.
*
*
* @param oldValue
* old value before change
* @param newValue
* new value after change
*/
public Values(final Object oldValue, final Object newValue) {
public PropertyChange(final Object oldValue, final Object newValue) {
super();
this.oldValue = oldValue;
this.newValue = newValue;
@@ -78,6 +78,5 @@ public class AbstractPropertyChangeEvent<E extends TenantAwareBaseEntity> extend
public Object getNewValue() {
return newValue;
}
}
}

View File

@@ -22,8 +22,7 @@ public class ActionPropertyChangeEvent extends AbstractPropertyChangeEvent<Actio
* @param action
* @param changeSetValues
*/
public ActionPropertyChangeEvent(final Action action,
final Map<String, AbstractPropertyChangeEvent<Action>.Values> changeSetValues) {
public ActionPropertyChangeEvent(final Action action, final Map<String, PropertyChange> changeSetValues) {
super(action, changeSetValues);
}

View File

@@ -20,12 +20,12 @@ public class RolloutGroupPropertyChangeEvent extends AbstractPropertyChangeEvent
private static final long serialVersionUID = 4026477044419472686L;
/**
*
*
* @param rolloutGroup
* @param changeSetValues
*/
public RolloutGroupPropertyChangeEvent(final RolloutGroup rolloutGroup,
final Map<String, AbstractPropertyChangeEvent<RolloutGroup>.Values> changeSetValues) {
final Map<String, PropertyChange> changeSetValues) {
super(rolloutGroup, changeSetValues);
}

View File

@@ -19,12 +19,11 @@ public class RolloutPropertyChangeEvent extends AbstractPropertyChangeEvent<Roll
private static final long serialVersionUID = 1056221355466373514L;
/**
*
*
* @param rollout
* @param changeSetValues
*/
public RolloutPropertyChangeEvent(final Rollout rollout,
final Map<String, AbstractPropertyChangeEvent<Rollout>.Values> changeSetValues) {
public RolloutPropertyChangeEvent(final Rollout rollout, final Map<String, PropertyChange> changeSetValues) {
super(rollout, changeSetValues);
}

View File

@@ -12,16 +12,9 @@ import java.io.Serializable;
/**
* An abstract report series.
*
*
*
*
*/
public class AbstractReportSeries implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private final String name;

View File

@@ -14,13 +14,11 @@ import java.util.List;
/**
* A simple list report series which just contains a list of values of a report.
*
*
*
*
*/
public class ListReportSeries extends AbstractReportSeries {
private static final long serialVersionUID = 1L;
private final List<Number> data = new ArrayList<>();
/**
@@ -50,8 +48,8 @@ public class ListReportSeries extends AbstractReportSeries {
* @param values
*/
private void setData(final Number... values) {
this.data.clear();
Collections.addAll(this.data, values);
data.clear();
Collections.addAll(data, values);
}
/**