Created
April 5, 2020 15:50
-
-
Save dexhunter/79ce1fef0a90d0edb6f421c102a9b958 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 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