Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. class EvaluatorBuilder{
  2.  
  3. public static Evaluator build(Evaluator.TYPE type) throws InvalidEvaluation
  4. {
  5. if(type.equals(Evaluator.TYPE.INVALID)) throw new InvalidEvaluation();
  6. if(type.equals(Evaluator.TYPE.MORE_EXPERIENCE)) return new MoreExpEvaluator();
  7. if(type.equals(Evaluator.TYPE.MORE_CREDIT_SCORE)) return new MoreCreditEvaluator();
  8. if(type.equals(Evaluator.TYPE.NO_CRIMINAL_RECORD_AND_MORE_EXPERIENCE)) return new NoCriminalAndMoreExp();
  9. if(type.equals(Evaluator.TYPE.MORE_EXPERIENCE_AND_MORE_CREDIT_SCORE)) return new MoreExpAndMoreCredit();
  10. if(type.equals(Evaluator.TYPE.NO_CRIMINAL_RECORD_AND_MORE_CREDIT_SCORE)) return new NoCriminalAndMoreCredit();
  11. throw new InvalidEvaluation();
  12. }
  13.  
  14. }
  15.  
  16. class MoreExpEvaluator implements Evaluator{
  17. @Override
  18. public boolean evaluate(Applicant applicant) {
  19. // TODO Auto-generated method stub
  20. return applicant.getEmploymentYears() >= 10;
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement