Update ListEntry contract

Conform to Lambdas
This commit is contained in:
NMerz 2020-10-08 18:40:09 -04:00
parent d293864d04
commit c9c07607b6
2 changed files with 5 additions and 8 deletions

View File

@ -21,7 +21,6 @@ import org.json.JSONException;
import java.io.IOException; import java.io.IOException;
import java.time.Instant; import java.time.Instant;
import java.time.ZoneOffset;
import java.util.Arrays; import java.util.Arrays;
import java.util.Properties; import java.util.Properties;
import java.util.Random; import java.util.Random;
@ -86,7 +85,7 @@ public class MainActivity extends AppCompatActivity {
//The name is the only part of this that is used, the rest is generated by the Lambda. //The name is the only part of this that is used, the rest is generated by the Lambda.
List testList = new List(-1, "New List", "user filled by lambda", Instant.now().toEpochMilli()); List testList = new List(-1, "New List", "user filled by lambda", Instant.now().toEpochMilli());
//Everything except addedDate is used for ItemEntry //Everything except addedDate is used for ItemEntry
ListEntry entry = new ListEntry(1, 1, new Random().nextInt(), Instant.now().atZone(ZoneOffset.UTC).toLocalDateTime(),false); ListEntry entry = new ListEntry(1, 1, new Random().nextInt(), Instant.now().toEpochMilli(),false);
SynchronousReceiver<Integer> idReceiver = new SynchronousReceiver<>(); SynchronousReceiver<Integer> idReceiver = new SynchronousReceiver<>();
try { try {
requestor.postObject(testList, idReceiver, idReceiver); requestor.postObject(testList, idReceiver, idReceiver);

View File

@ -1,15 +1,13 @@
package com.example.listify.data; package com.example.listify.data;
import java.time.LocalDateTime;
public class ListEntry { public class ListEntry {
Integer listID; Integer listID;
Integer productID; Integer productID;
Integer quantity; Integer quantity;
LocalDateTime addedDate; long addedDate;
Boolean purchased; Boolean purchased;
public ListEntry(Integer listID, Integer productID, Integer quantity, LocalDateTime addedDate, Boolean purchased) { public ListEntry(Integer listID, Integer productID, Integer quantity, long addedDate, Boolean purchased) {
this.listID = listID; this.listID = listID;
this.productID = productID; this.productID = productID;
this.quantity = quantity; this.quantity = quantity;
@ -52,11 +50,11 @@ public class ListEntry {
this.quantity = quantity; this.quantity = quantity;
} }
public LocalDateTime getAddedDate() { public long getAddedDate() {
return addedDate; return addedDate;
} }
public void setAddedDate(LocalDateTime addedDate) { public void setAddedDate(long addedDate) {
this.addedDate = addedDate; this.addedDate = addedDate;
} }