Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class EvaluatorBuilder{
- public static Evaluator build(Evaluator.TYPE type) throws InvalidEvaluation
- {
- if(type.equals(Evaluator.TYPE.INVALID)) throw new InvalidEvaluation();
- if(type.equals(Evaluator.TYPE.MORE_EXPERIENCE)) return new MoreExpEvaluator();
- if(type.equals(Evaluator.TYPE.MORE_CREDIT_SCORE)) return new MoreCreditEvaluator();
- if(type.equals(Evaluator.TYPE.NO_CRIMINAL_RECORD_AND_MORE_EXPERIENCE)) return new NoCriminalAndMoreExp();
- if(type.equals(Evaluator.TYPE.MORE_EXPERIENCE_AND_MORE_CREDIT_SCORE)) return new MoreExpAndMoreCredit();
- if(type.equals(Evaluator.TYPE.NO_CRIMINAL_RECORD_AND_MORE_CREDIT_SCORE)) return new NoCriminalAndMoreCredit();
- throw new InvalidEvaluation();
- }
- }
- class MoreExpEvaluator implements Evaluator{
- @Override
- public boolean evaluate(Applicant applicant) {
- // TODO Auto-generated method stub
- return applicant.getEmploymentYears() >= 10;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement