use of com.google.visualization.datasource.datatable.value.NumberValue in project uPortal by Jasig.
the class LoginTotalsStatisticsController method createRowValues.
@Override
protected List<Value> createRowValues(LoginAggregation aggr, LoginReportForm form) {
final int loginCount;
final int uniqueLoginCount;
if (aggr == null) {
loginCount = 0;
uniqueLoginCount = 0;
} else {
loginCount = aggr.getLoginCount();
uniqueLoginCount = aggr.getUniqueLoginCount();
}
if (form.isTotalLogins() && form.isUniqueLogins()) {
return ImmutableList.<Value>of(//THE ORDER OF RETURNED VALUES HERE MUST MATCH THE ORDER OF THE COLUMNS RETURNED IN getColumnDescriptions
new NumberValue(uniqueLoginCount), new NumberValue(loginCount));
} else if (form.isUniqueLogins()) {
return Collections.<Value>singletonList(new NumberValue(uniqueLoginCount));
} else {
return Collections.<Value>singletonList(new NumberValue(loginCount));
}
}
Aggregations