Created
March 19, 2021 04:07
-
-
Save srdelarosa/41f5a03800a8602e2b191162b94eb536 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.newhorizons.takeitnow.item.domain.entity; | |
public class Item { | |
private Product product; | |
private Long quantity; | |
public Item() { | |
} | |
public Item(Product product, Long quantity) { | |
this.product = product; | |
this.quantity = quantity; | |
} | |
public Product getProduct() { | |
return product; | |
} | |
public void setProduct(Product product) { | |
this.product = product; | |
} | |
public Long getQuantity() { | |
return quantity; | |
} | |
public void setQuantity(Long quantity) { | |
this.quantity = quantity; | |
} | |
public Double getTotal(){ | |
return product.getPrice() * quantity.doubleValue(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment