Last active
May 6, 2016 20:03
-
-
Save BobGu/80e87c663e485da51ec618d786375903 to your computer and use it in GitHub Desktop.
This file contains 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
public class UnpaidState implements State { | |
private Order order; | |
public UnpaidState(Order order) { | |
this.order = order; | |
} | |
public void verifyCreditCard(String info) { | |
if (verifyCreditCard(info)) { | |
order.setState(order.getPaidState()); | |
} | |
} | |
public void ship() { | |
System.out.println("Sorry can't ship an item unless it's paid"); | |
} | |
public void orderDelivered() { | |
System.out.println("Order hasn't shipped yet!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment