Merge branch 'master' into list-renaming

This commit is contained in:
Nathan Merz
2020-11-20 15:56:57 -05:00
committed by GitHub
22 changed files with 625 additions and 39 deletions

View File

@@ -9,18 +9,16 @@ public class List {
long lastUpdated;
ArrayList<ItemEntry> entries;
boolean shared;
Integer uiPosition;
public List(ResultSet listRow, boolean shared) throws SQLException {
public List(ResultSet listRow, boolean shared, Integer uiPosition) throws SQLException {
listID = listRow.getInt("listID");
name = listRow.getString("name");
owner = listRow.getString("owner");
lastUpdated = listRow.getTimestamp("lastUpdated").toInstant().toEpochMilli();
entries = new ArrayList<>();
this.shared = shared;
}
public void addItemEntry(ItemEntry entry) {
entries.add(entry);
this.uiPosition = uiPosition;
}
@Override
@@ -31,9 +29,12 @@ public class List {
", owner='" + owner + '\'' +
", lastUpdated=" + lastUpdated +
", entries=" + entries +
", shared=" + shared +
", uiPosition=" + uiPosition +
'}';
}
public ItemEntry[] getEntries() {
return entries.toArray(new ItemEntry[entries.size()]);
}
@@ -77,4 +78,19 @@ public class List {
public void setShared(boolean shared) {
this.shared = shared;
}
public Integer getUiPosition() {
return uiPosition;
}
public void setUiPosition(Integer uiPosition) {
this.uiPosition = uiPosition;
public ItemEntry[] getEntries() {
return entries.toArray(new ItemEntry[entries.size()]);
}
public void addItemEntry(ItemEntry entry) {
entries.add(entry);
}
}