Skip to content

Instantly share code, notes, and snippets.

@srdelarosa
Created March 19, 2021 04:07
Show Gist options
  • Save srdelarosa/41f5a03800a8602e2b191162b94eb536 to your computer and use it in GitHub Desktop.
Save srdelarosa/41f5a03800a8602e2b191162b94eb536 to your computer and use it in GitHub Desktop.
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