mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 10:48:46 +00:00
Update ListEntry contract
Conform to Lambdas
This commit is contained in:
parent
d293864d04
commit
c9c07607b6
@ -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);
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user