mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2026-03-11 11:05:05 +00:00
GET strcuture
Build out infrastructure for get requests (along with the first couple). This includes changing the request engine from Volley to OKHTTP due to issues get Volley's callbacks to call back.
This commit is contained in:
52
Lambdas/Lists/Item/src/Item.java
Normal file
52
Lambdas/Lists/Item/src/Item.java
Normal file
@@ -0,0 +1,52 @@
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class Item {
|
||||
Integer productID;
|
||||
Integer chainID;
|
||||
String upc;
|
||||
String description;
|
||||
BigDecimal price;
|
||||
String imageURL;
|
||||
String department;
|
||||
LocalDateTime retrievedDate;
|
||||
Integer fetchCounts;
|
||||
|
||||
Item(ResultSet itemRow) throws SQLException {
|
||||
this.productID = itemRow.getInt(1);
|
||||
System.out.println(this.productID);
|
||||
this.chainID = itemRow.getInt(2);
|
||||
System.out.println(this.chainID);
|
||||
this.upc = itemRow.getString(3);
|
||||
System.out.println(this.upc);
|
||||
this.description = itemRow.getString(4);
|
||||
System.out.println(this.description);
|
||||
this.price = itemRow.getBigDecimal(5);
|
||||
System.out.println(this.price);
|
||||
this.imageURL = itemRow.getString(6);
|
||||
System.out.println(imageURL);
|
||||
this.department = itemRow.getString(7);
|
||||
System.out.println(department);
|
||||
this.retrievedDate = itemRow.getObject(8, LocalDateTime.class);
|
||||
System.out.println(retrievedDate);
|
||||
this.fetchCounts = itemRow.getInt(9);
|
||||
System.out.println(fetchCounts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Item{" +
|
||||
"productID=" + productID +
|
||||
", chainID=" + chainID +
|
||||
", upc='" + upc + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", price=" + price +
|
||||
", imageURL='" + imageURL + '\'' +
|
||||
", department='" + department + '\'' +
|
||||
", retrievedDate=" + retrievedDate +
|
||||
", fetchCounts=" + fetchCounts +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user