Skip to content

Instantly share code, notes, and snippets.

@dexhunter
Created April 5, 2020 15:50
Show Gist options
  • Save dexhunter/79ce1fef0a90d0edb6f421c102a9b958 to your computer and use it in GitHub Desktop.
Save dexhunter/79ce1fef0a90d0edb6f421c102a9b958 to your computer and use it in GitHub Desktop.
public interface FitnessCustomer {
private static enum Level {
BRONZE, SILVER, GOLD
}
private Level level;
public void setLevel(Level level) {
this.level = level;
}
public Level getLevel() {
return this.level;
}
public double getFees();
public boolean canAccessPool(){
return false;
}
public boolean hasOwnLocker(){
return false;
}
public double getEquipmentDiscount();
}
public class BronzeFitnessCustomer extends FitnessCustomer {
@Override
public double getFees() {
return CustomerConstants.BRONZE_FEES;
}
@Override
public double getEquipmentDiscount() {
return CustomerConstants.BRONZE_DISCOUNT;
}
}
public class SilverFitnessCustomer extends FitnessCustomer {
@Override
public double getFees() {
return CustomerConstants.SILVER_FEES;
}
@Override
public double getEquipmentDiscount() {
return CustomerConstants.SILVER_DISCOUNT;
}
@Override
public boolean canAccessPool() {
return true;
}
}
public class GoldFitnessCustomer extends FitnessCustomer {
@Override
public double getFees() {
return CustomerConstants.GOLD_FEES;
}
@Override
public double getEquipmentDiscount() {
return CustomerConstants.GOLD_DISCOUNT;
}
@Override
public boolean canAccessPool() {
return true;
}
@Override
public boolean hasOwnLocker() {
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment