Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CheckOut implements EstadoOrder {
- private static final CheckOut instancia = new CheckOut();
- private CheckOut(){}
- public static CheckOut getInstancia(){ return instancia; }
- @Override
- public void anteriorEstado(Order order) {
- order.setEstado(ShoppingCart.getInstancia());
- }
- @Override
- public void modificarCantidadProducto(Order order, Product producto) {
- }
- @Override
- public void pagar(Order order) {
- }
- @Override
- public void cancelar(Order order) {
- }
- @Override
- public void anadirProducto(Order order, Product producto) {
- }
- @Override
- public void eliminarProducto(Order order, Product producto) {
- order.getLista().remove(producto);
- producto.setStock(producto.getStock()+1);
- }
- @Override
- public void siguienteEstado(Order order) {
- order.setEstado(Payment.getInstancia());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement