Created
March 13, 2025 19:45
-
-
Save trikitrok/9325892bd4aaf4141d75fd6317dc4eec 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 interface Customer { | |
double getEarnedDiscount(); | |
void addToOrdersHistory(Order order); | |
} | |
// Null Customer's implementation | |
public class NotFoundCustomer implements Customer { | |
private final double DEFAULT_DISCOUNT = 1.0; | |
@Override | |
public double getEarnedDiscount() { | |
return DEFAULT_DISCOUNT; | |
} | |
// Refused bequest??? | |
@Override | |
public void addToOrdersHistory(Order order) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment