apply new code formatter and save action

This commit is contained in:
2019-11-24 10:20:43 +01:00
parent 5ea82c6a4c
commit 06b379494f
184 changed files with 13455 additions and 13489 deletions

View File

@@ -1,36 +1,36 @@
package org.lucares.pdbui.domain;
public class AutocompleteProposal {
private String value;
private String newQuery;
private int newCaretPosition;
private String value;
private String newQuery;
private int newCaretPosition;
public String getValue() {
return value;
}
public String getValue() {
return value;
}
public void setValue(final String value) {
this.value = value;
}
public void setValue(final String value) {
this.value = value;
}
@Override
public String toString() {
return value;
}
@Override
public String toString() {
return value;
}
public int getNewCaretPosition() {
return newCaretPosition;
}
public int getNewCaretPosition() {
return newCaretPosition;
}
public void setNewCaretPosition(final int newCaretPosition) {
this.newCaretPosition = newCaretPosition;
}
public void setNewCaretPosition(final int newCaretPosition) {
this.newCaretPosition = newCaretPosition;
}
public String getNewQuery() {
return newQuery;
}
public String getNewQuery() {
return newQuery;
}
public void setNewQuery(final String newQuery) {
this.newQuery = newQuery;
}
public void setNewQuery(final String newQuery) {
this.newQuery = newQuery;
}
}

View File

@@ -4,9 +4,9 @@ import java.util.Comparator;
public class AutocompleteProposalByValue implements Comparator<AutocompleteProposal> {
@Override
public int compare(final AutocompleteProposal o1, final AutocompleteProposal o2) {
return o1.getValue().compareToIgnoreCase(o2.getValue());
}
@Override
public int compare(final AutocompleteProposal o1, final AutocompleteProposal o2) {
return o1.getValue().compareToIgnoreCase(o2.getValue());
}
}

View File

@@ -3,19 +3,19 @@ package org.lucares.pdbui.domain;
import java.util.List;
public class AutocompleteResponse {
private List<AutocompleteProposal> proposals;
private List<AutocompleteProposal> proposals;
public List<AutocompleteProposal> getProposals() {
return proposals;
}
public List<AutocompleteProposal> getProposals() {
return proposals;
}
public void setProposals(final List<AutocompleteProposal> proposals) {
this.proposals = proposals;
}
public void setProposals(final List<AutocompleteProposal> proposals) {
this.proposals = proposals;
}
@Override
public String toString() {
return String.valueOf(proposals);
}
@Override
public String toString() {
return String.valueOf(proposals);
}
}

View File

@@ -3,62 +3,62 @@ package org.lucares.pdbui.domain;
import java.util.Collection;
public class DataSeriesStats {
private final int values;
private final long maxValue;
private final double average;
private final int plottedValues;
private final int values;
private final long maxValue;
private final double average;
private final int plottedValues;
public DataSeriesStats(final int values, final int plottedValues, final long maxValue, final double average) {
this.values = values;
this.plottedValues = plottedValues;
this.maxValue = maxValue;
this.average = average;
}
public DataSeriesStats(final int values, final int plottedValues, final long maxValue, final double average) {
this.values = values;
this.plottedValues = plottedValues;
this.maxValue = maxValue;
this.average = average;
}
/**
* The number of values in the date range, without applying the y-range.
*
* @return total number of values
*/
public int getValues() {
return values;
}
/**
* The number of values in the date range, without applying the y-range.
*
* @return total number of values
*/
public int getValues() {
return values;
}
/**
* The number of values in the date range <em>and</em> the y-range.
*
* @return number of plotted values
*/
public int getPlottedValues() {
return plottedValues;
}
/**
* The number of values in the date range <em>and</em> the y-range.
*
* @return number of plotted values
*/
public int getPlottedValues() {
return plottedValues;
}
public long getMaxValue() {
return maxValue;
}
public long getMaxValue() {
return maxValue;
}
public double getAverage() {
return average;
}
public double getAverage() {
return average;
}
@Override
public String toString() {
return "[values=" + values + ", maxValue=" + maxValue + ", average=" + average + "]";
}
@Override
public String toString() {
return "[values=" + values + ", maxValue=" + maxValue + ", average=" + average + "]";
}
public static double average(final Collection<DataSeriesStats> stats) {
long n = 0;
double average = 0;
public static double average(final Collection<DataSeriesStats> stats) {
long n = 0;
double average = 0;
for (final DataSeriesStats stat : stats) {
final int newValues = stat.getValues();
final double newAverage = stat.getAverage();
if (newValues > 0) {
average = (average * n + newAverage * newValues) / (n + newValues);
n += newValues;
}
}
for (final DataSeriesStats stat : stats) {
final int newValues = stat.getValues();
final double newAverage = stat.getAverage();
if (newValues > 0) {
average = (average * n + newAverage * newValues) / (n + newValues);
n += newValues;
}
}
return average;
}
return average;
}
}

View File

@@ -9,68 +9,68 @@ import org.lucares.pdb.api.DateTimeRange;
public class DateRange {
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
private String startDate;
private String endDate;
private String startDate;
private String endDate;
DateRange() {
super();
}
DateRange() {
super();
}
/**
*
* @param startDate date in format 'yyyy-MM-dd HH:mm:ss'
* @param endDate date in format 'yyyy-MM-dd HH:mm:ss'
*/
public DateRange(final String startDate, final String endDate) {
this.startDate = startDate;
this.endDate = endDate;
}
/**
*
* @param startDate date in format 'yyyy-MM-dd HH:mm:ss'
* @param endDate date in format 'yyyy-MM-dd HH:mm:ss'
*/
public DateRange(final String startDate, final String endDate) {
this.startDate = startDate;
this.endDate = endDate;
}
/**
*
* @return date in format 'yyyy-MM-dd HH:mm:ss'
*/
public String getStartDate() {
return startDate;
}
/**
*
* @return date in format 'yyyy-MM-dd HH:mm:ss'
*/
public String getStartDate() {
return startDate;
}
/**
*
* @param startDate date in format 'yyyy-MM-dd HH:mm:ss'
*/
public void setStartDate(final String startDate) {
this.startDate = startDate;
}
/**
*
* @param startDate date in format 'yyyy-MM-dd HH:mm:ss'
*/
public void setStartDate(final String startDate) {
this.startDate = startDate;
}
/**
*
* @return date in format 'yyyy-MM-dd HH:mm:ss'
*/
public String getEndDate() {
return endDate;
}
/**
*
* @return date in format 'yyyy-MM-dd HH:mm:ss'
*/
public String getEndDate() {
return endDate;
}
/**
*
* @param endDate date in format 'yyyy-MM-dd HH:mm:ss'
*/
public void setEndDate(final String endDate) {
this.endDate = endDate;
}
/**
*
* @param endDate date in format 'yyyy-MM-dd HH:mm:ss'
*/
public void setEndDate(final String endDate) {
this.endDate = endDate;
}
@Override
public String toString() {
return startDate + " - " + endDate;
}
@Override
public String toString() {
return startDate + " - " + endDate;
}
public DateTimeRange toDateTimeRange() {
public DateTimeRange toDateTimeRange() {
final OffsetDateTime start = LocalDateTime.parse(startDate, DATE_FORMAT).atOffset(ZoneOffset.UTC);
final OffsetDateTime end = LocalDateTime.parse(endDate, DATE_FORMAT).atOffset(ZoneOffset.UTC);
final OffsetDateTime start = LocalDateTime.parse(startDate, DATE_FORMAT).atOffset(ZoneOffset.UTC);
final OffsetDateTime end = LocalDateTime.parse(endDate, DATE_FORMAT).atOffset(ZoneOffset.UTC);
return new DateTimeRange(start, end);
}
return new DateTimeRange(start, end);
}
}

View File

@@ -6,39 +6,39 @@ import java.util.List;
import java.util.Set;
public class FilterDefaults {
private Set<String> groupBy;
private List<String> fields;
private Set<String> groupBy;
private String splitBy;
private List<String> fields;
public FilterDefaults(final List<String> fields, final Set<String> groupBy, final String splitBy) {
this.fields = new ArrayList<String>(fields);
this.groupBy = new HashSet<String>(groupBy);
this.splitBy = splitBy;
}
private String splitBy;
public Set<String> getGroupBy() {
return new HashSet<String>(groupBy);
}
public FilterDefaults(final List<String> fields, final Set<String> groupBy, final String splitBy) {
this.fields = new ArrayList<String>(fields);
this.groupBy = new HashSet<String>(groupBy);
this.splitBy = splitBy;
}
public void setGroupBy(Set<String> groupBy) {
this.groupBy = new HashSet<String>(groupBy);
}
public Set<String> getGroupBy() {
return new HashSet<String>(groupBy);
}
public List<String> getFields() {
return new ArrayList<String>(fields);
}
public void setGroupBy(Set<String> groupBy) {
this.groupBy = new HashSet<String>(groupBy);
}
public void setFields(List<String> fields) {
this.fields = new ArrayList<String>(fields);
}
public List<String> getFields() {
return new ArrayList<String>(fields);
}
public String getSplitBy() {
return splitBy;
}
public void setFields(List<String> fields) {
this.fields = new ArrayList<String>(fields);
}
public void setSplitBy(String splitBy) {
this.splitBy = splitBy;
}
public String getSplitBy() {
return splitBy;
}
public void setSplitBy(String splitBy) {
this.splitBy = splitBy;
}
}

View File

@@ -8,166 +8,166 @@ import org.lucares.pdb.plot.api.AxisScale;
import org.lucares.pdb.plot.api.Limit;
public class PlotRequest {
private String query;
private String query;
private int height = 1000;
private int height = 1000;
private int width = 1000;
private int width = 1000;
private int thumbnailMaxWidth = 0;
private int thumbnailMaxWidth = 0;
private int thumbnailMaxHeight = 0;
private int thumbnailMaxHeight = 0;
private List<String> groupBy;
private List<String> groupBy;
private Limit limitBy = Limit.NO_LIMIT;
private Limit limitBy = Limit.NO_LIMIT;
private AxisScale yAxisScale = AxisScale.LINEAR;
private AxisScale yAxisScale = AxisScale.LINEAR;
private int limit = Integer.MAX_VALUE;
private int limit = Integer.MAX_VALUE;
private String dateRange;
private String dateRange;
private List<Aggregate> aggregates = new ArrayList<>();
private List<Aggregate> aggregates = new ArrayList<>();
private int yRangeMin;
private int yRangeMax;
private TimeRangeUnit yRangeUnit = TimeRangeUnit.AUTOMATIC;
private int yRangeMin;
private int yRangeMax;
private TimeRangeUnit yRangeUnit = TimeRangeUnit.AUTOMATIC;
private boolean keyOutside;
private boolean keyOutside;
private boolean generateThumbnail;
private boolean generateThumbnail;
public String getQuery() {
return query;
}
public String getQuery() {
return query;
}
public void setQuery(final String query) {
this.query = query;
}
public void setQuery(final String query) {
this.query = query;
}
public int getWidth() {
return width;
}
public int getWidth() {
return width;
}
public void setWidth(final int width) {
this.width = width;
}
public void setWidth(final int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public int getHeight() {
return height;
}
public void setHeight(final int height) {
this.height = height;
}
public void setHeight(final int height) {
this.height = height;
}
public int getThumbnailMaxWidth() {
return thumbnailMaxWidth;
}
public int getThumbnailMaxWidth() {
return thumbnailMaxWidth;
}
public void setThumbnailMaxWidth(final int thumbnailMaxWidth) {
this.thumbnailMaxWidth = thumbnailMaxWidth;
}
public void setThumbnailMaxWidth(final int thumbnailMaxWidth) {
this.thumbnailMaxWidth = thumbnailMaxWidth;
}
public int getThumbnailMaxHeight() {
return thumbnailMaxHeight;
}
public int getThumbnailMaxHeight() {
return thumbnailMaxHeight;
}
public void setThumbnailMaxHeight(final int thumbnailMaxHeight) {
this.thumbnailMaxHeight = thumbnailMaxHeight;
}
public void setThumbnailMaxHeight(final int thumbnailMaxHeight) {
this.thumbnailMaxHeight = thumbnailMaxHeight;
}
@Override
public String toString() {
return query + ":" + height + "x" + width;
}
@Override
public String toString() {
return query + ":" + height + "x" + width;
}
public List<String> getGroupBy() {
return groupBy;
}
public List<String> getGroupBy() {
return groupBy;
}
public void setGroupBy(final List<String> groupBy) {
this.groupBy = groupBy;
}
public void setGroupBy(final List<String> groupBy) {
this.groupBy = groupBy;
}
public Limit getLimitBy() {
return limitBy;
}
public Limit getLimitBy() {
return limitBy;
}
public void setLimitBy(final Limit limitBy) {
this.limitBy = limitBy;
}
public void setLimitBy(final Limit limitBy) {
this.limitBy = limitBy;
}
public int getLimit() {
return limit;
}
public int getLimit() {
return limit;
}
public void setLimit(final int limit) {
this.limit = limit;
}
public void setLimit(final int limit) {
this.limit = limit;
}
public String getDateRange() {
return dateRange;
}
public String getDateRange() {
return dateRange;
}
public void setDateRange(final String dateRange) {
this.dateRange = dateRange;
}
public void setDateRange(final String dateRange) {
this.dateRange = dateRange;
}
public AxisScale getAxisScale() {
return yAxisScale;
}
public AxisScale getAxisScale() {
return yAxisScale;
}
public void setAxisScale(final AxisScale yAxis) {
this.yAxisScale = yAxis;
}
public void setAxisScale(final AxisScale yAxis) {
this.yAxisScale = yAxis;
}
public void setAggregate(final List<Aggregate> aggregates) {
this.aggregates = aggregates;
}
public void setAggregate(final List<Aggregate> aggregates) {
this.aggregates = aggregates;
}
public List<Aggregate> getAggregates() {
return aggregates;
}
public List<Aggregate> getAggregates() {
return aggregates;
}
public void setKeyOutside(final boolean keyOutside) {
this.keyOutside = keyOutside;
}
public void setKeyOutside(final boolean keyOutside) {
this.keyOutside = keyOutside;
}
public boolean isKeyOutside() {
return keyOutside;
}
public boolean isKeyOutside() {
return keyOutside;
}
public boolean isGenerateThumbnail() {
return generateThumbnail;
}
public boolean isGenerateThumbnail() {
return generateThumbnail;
}
public void setGenerateThumbnail(final boolean generateThumbnail) {
this.generateThumbnail = generateThumbnail;
}
public void setGenerateThumbnail(final boolean generateThumbnail) {
this.generateThumbnail = generateThumbnail;
}
public int getyRangeMin() {
return yRangeMin;
}
public int getyRangeMin() {
return yRangeMin;
}
public void setyRangeMin(final int yRangeMin) {
this.yRangeMin = yRangeMin;
}
public void setyRangeMin(final int yRangeMin) {
this.yRangeMin = yRangeMin;
}
public int getyRangeMax() {
return yRangeMax;
}
public int getyRangeMax() {
return yRangeMax;
}
public void setyRangeMax(final int yRangeMax) {
this.yRangeMax = yRangeMax;
}
public void setyRangeMax(final int yRangeMax) {
this.yRangeMax = yRangeMax;
}
public TimeRangeUnit getyRangeUnit() {
return yRangeUnit;
}
public TimeRangeUnit getyRangeUnit() {
return yRangeUnit;
}
public void setyRangeUnit(final TimeRangeUnit yRangeUnit) {
this.yRangeUnit = yRangeUnit;
}
public void setyRangeUnit(final TimeRangeUnit yRangeUnit) {
this.yRangeUnit = yRangeUnit;
}
}

View File

@@ -1,43 +1,43 @@
package org.lucares.pdbui.domain;
public class PlotResponse {
private String imageUrl = "";
private PlotResponseStats stats;
private String thumbnailUrl;
private String imageUrl = "";
private PlotResponseStats stats;
private String thumbnailUrl;
public PlotResponse(final PlotResponseStats stats, final String imageUrl, final String thumbnailUrl) {
this.stats = stats;
this.imageUrl = imageUrl;
this.thumbnailUrl = thumbnailUrl;
}
public PlotResponse(final PlotResponseStats stats, final String imageUrl, final String thumbnailUrl) {
this.stats = stats;
this.imageUrl = imageUrl;
this.thumbnailUrl = thumbnailUrl;
}
public String getImageUrl() {
return imageUrl;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(final String imageUrl) {
this.imageUrl = imageUrl;
}
public void setImageUrl(final String imageUrl) {
this.imageUrl = imageUrl;
}
public String getThumbnailUrl() {
return thumbnailUrl;
}
public String getThumbnailUrl() {
return thumbnailUrl;
}
public PlotResponseStats getStats() {
return stats;
}
public PlotResponseStats getStats() {
return stats;
}
public void setStats(final PlotResponseStats stats) {
this.stats = stats;
}
public void setStats(final PlotResponseStats stats) {
this.stats = stats;
}
public void setThumbnailUrl(final String thumbnailUrl) {
this.thumbnailUrl = thumbnailUrl;
}
public void setThumbnailUrl(final String thumbnailUrl) {
this.thumbnailUrl = thumbnailUrl;
}
@Override
public String toString() {
return "PlotResponse [imageUrl=" + imageUrl + ", stats=" + stats + ", thumbnailUrl=" + thumbnailUrl + "]";
}
@Override
public String toString() {
return "PlotResponse [imageUrl=" + imageUrl + ", stats=" + stats + ", thumbnailUrl=" + thumbnailUrl + "]";
}
}

View File

@@ -6,94 +6,94 @@ import java.util.List;
import org.lucares.recommind.logs.DataSeries;
public class PlotResponseStats {
private long maxValue;
private long maxValue;
private int values;
private int values;
private double average;
private double average;
private int plottedValues;
private int plottedValues;
private List<DataSeriesStats> dataSeriesStats;
private List<DataSeriesStats> dataSeriesStats;
public PlotResponseStats() {
super();
}
public PlotResponseStats() {
super();
}
public PlotResponseStats(final long maxValue, final int values, final int plottedValues, final double average,
final List<DataSeriesStats> dataSeriesStats) {
public PlotResponseStats(final long maxValue, final int values, final int plottedValues, final double average,
final List<DataSeriesStats> dataSeriesStats) {
this.maxValue = maxValue;
this.values = values;
this.plottedValues = plottedValues;
this.average = average;
this.dataSeriesStats = dataSeriesStats;
}
this.maxValue = maxValue;
this.values = values;
this.plottedValues = plottedValues;
this.average = average;
this.dataSeriesStats = dataSeriesStats;
}
public long getMaxValue() {
return maxValue;
}
public long getMaxValue() {
return maxValue;
}
public void setMaxValue(final long maxValue) {
this.maxValue = maxValue;
}
public void setMaxValue(final long maxValue) {
this.maxValue = maxValue;
}
public int getValues() {
return values;
}
public int getValues() {
return values;
}
public void setValues(final int values) {
this.values = values;
}
public void setValues(final int values) {
this.values = values;
}
public int getPlottedValues() {
return plottedValues;
}
public int getPlottedValues() {
return plottedValues;
}
public void setPlottedValues(final int plottedValues) {
this.plottedValues = plottedValues;
}
public void setPlottedValues(final int plottedValues) {
this.plottedValues = plottedValues;
}
public double getAverage() {
return average;
}
public double getAverage() {
return average;
}
public void setAverage(final double average) {
this.average = average;
}
public void setAverage(final double average) {
this.average = average;
}
public List<DataSeriesStats> getDataSeriesStats() {
return dataSeriesStats;
}
public List<DataSeriesStats> getDataSeriesStats() {
return dataSeriesStats;
}
public void setDataSeriesStats(final List<DataSeriesStats> dataSeriesStats) {
this.dataSeriesStats = dataSeriesStats;
}
public void setDataSeriesStats(final List<DataSeriesStats> dataSeriesStats) {
this.dataSeriesStats = dataSeriesStats;
}
@Override
public String toString() {
return "PlotResponseStats [maxValue=" + maxValue + ", values=" + values + ", average=" + average
+ ", plottedValues=" + plottedValues + ", dataSeriesStats=" + dataSeriesStats + "]";
}
@Override
public String toString() {
return "PlotResponseStats [maxValue=" + maxValue + ", values=" + values + ", average=" + average
+ ", plottedValues=" + plottedValues + ", dataSeriesStats=" + dataSeriesStats + "]";
}
public static PlotResponseStats fromDataSeries(final List<DataSeries> dataSeries) {
public static PlotResponseStats fromDataSeries(final List<DataSeries> dataSeries) {
int values = 0;
int plottedValues = 0;
long maxValue = 0;
final List<DataSeriesStats> dataSeriesStats = new ArrayList<>();
int values = 0;
int plottedValues = 0;
long maxValue = 0;
final List<DataSeriesStats> dataSeriesStats = new ArrayList<>();
for (final DataSeries dataSerie : dataSeries) {
values += dataSerie.getValues();
plottedValues += dataSerie.getPlottedValues();
maxValue = Math.max(maxValue, dataSerie.getMaxValue());
for (final DataSeries dataSerie : dataSeries) {
values += dataSerie.getValues();
plottedValues += dataSerie.getPlottedValues();
maxValue = Math.max(maxValue, dataSerie.getMaxValue());
dataSeriesStats.add(new DataSeriesStats(dataSerie.getValues(), dataSerie.getPlottedValues(),
dataSerie.getMaxValue(), dataSerie.getAverage()));
}
dataSeriesStats.add(new DataSeriesStats(dataSerie.getValues(), dataSerie.getPlottedValues(),
dataSerie.getMaxValue(), dataSerie.getAverage()));
}
final double average = Math.round(DataSeriesStats.average(dataSeriesStats));
final double average = Math.round(DataSeriesStats.average(dataSeriesStats));
return new PlotResponseStats(maxValue, values, plottedValues, average, dataSeriesStats);
}
return new PlotResponseStats(maxValue, values, plottedValues, average, dataSeriesStats);
}
}

View File

@@ -1,5 +1,5 @@
package org.lucares.pdbui.domain;
public enum TimeRangeUnit {
AUTOMATIC, MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS
AUTOMATIC, MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS
}