From 3b3062107501dc1868160c45eb506e2b0d7d52b3 Mon Sep 17 00:00:00 2001 From: Notmoo Date: Sun, 23 Jul 2017 18:45:50 +0200 Subject: [PATCH] Correction attr clss Product : "id" de type long et "price" de type double --- .../pqt/core/entities/product/Product.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Workspace/core/src/main/java/com/pqt/core/entities/product/Product.java b/Workspace/core/src/main/java/com/pqt/core/entities/product/Product.java index 58b9558b..2f72df2b 100644 --- a/Workspace/core/src/main/java/com/pqt/core/entities/product/Product.java +++ b/Workspace/core/src/main/java/com/pqt/core/entities/product/Product.java @@ -10,12 +10,12 @@ import java.util.List; * Created by Notmoo on 18/07/2017. */ public class Product implements ILoggable, Serializable{ - private int id; + private long id; private String name; private int amountRemaining; private int amountSold; private boolean sellable; - private boolean price; + private double price; private List components; private Category category; @@ -23,22 +23,25 @@ public class Product implements ILoggable, Serializable{ components = new ArrayList<>(); } - public Product(int id, String name, int amountRemaining, int amountSold, boolean sellable, boolean price, List components, Category category) { + public Product(long id, String name, int amountRemaining, int amountSold, boolean sellable, double price, List components, Category category) { this.id = id; this.name = name; this.amountRemaining = amountRemaining; this.amountSold = amountSold; this.sellable = sellable; this.price = price; - this.components = components; this.category = category; + this.components = new ArrayList<>(); + if(components!=null){ + this.components.addAll(components); + } } - public int getId() { + public long getId() { return id; } - public void setId(int id) { + public void setId(long id) { this.id = id; } @@ -74,11 +77,11 @@ public class Product implements ILoggable, Serializable{ this.sellable = sellable; } - public boolean isPrice() { + public double getPrice() { return price; } - public void setPrice(boolean price) { + public void setPrice(double price) { this.price = price; }