Store uiPosition

This will later be changeable and can then be used to sort lists received by the UI controller
This commit is contained in:
NMerz
2020-11-14 15:55:29 -05:00
parent 7cb9639f9a
commit 421fceb364
7 changed files with 51 additions and 28 deletions

View File

@@ -9,14 +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 {
itemID = listRow.getInt("listID");
name = listRow.getString("name");
owner = listRow.getString("owner");
lastUpdated = listRow.getTimestamp("lastUpdated").toInstant().toEpochMilli();
entries = new ArrayList<>();
this.shared = shared;
this.uiPosition = uiPosition;
}
public void addItemEntry(ItemEntry entry) {
@@ -31,6 +33,8 @@ public class List {
", owner='" + owner + '\'' +
", lastUpdated=" + lastUpdated +
", entries=" + entries +
", shared=" + shared +
", uiPosition=" + uiPosition +
'}';
}
@@ -77,4 +81,12 @@ public class List {
public void setShared(boolean shared) {
this.shared = shared;
}
public Integer getUiPosition() {
return uiPosition;
}
public void setUiPosition(Integer uiPosition) {
this.uiPosition = uiPosition;
}
}