SELECT Odea, Java, Developer
Resumen
public class OdeaJavaDeveloper
Aviso Completo
package ar.com.odea;
import ar.com.odea.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class OdeaJavaDeveloper {
private static final Logger logger = LoggerFactory.getLogger(OdeaJavaDeveloper.class);
public enum Skill { Spring(5), SQL(5), MVC(5), OOP(5), Hibernate(1), IBatis(1), Wicket(1),
JSF(1), CSS(1), JS(1);
// For simplicity, assume that exists all methods for compiling the class
}
public enum Address {BUENOS_AIRES, CABA, OTRO, MICROCENTRO}
public class Candidate {
private Collection skills;
private final int POINTS_NEEDED = 20;
private Address address;
private String name;
private String email;
private Double salary;
public Candidate(String name, Address address, String email, Double salary, Collection skills) {
this.skills = skills;
this.address = address;
this.name = name;
this.email = email;
this.salary = salary;
}
public int getTotalSkillPoints() {
int total = 0;
for (Skill skill : this.skills) {
total += skill.getValue();
}
return total;
}
public boolean isValid() {
if(Address.OTRO.equals(this.address)){
throw new LocationException();
else
return (this.getTotalSkillPoints() >= POINTS_NEEDED);
}
// For simplicity, assume that exists all methods for compiling the class.
}
public static void main(String[] args){
// TODO: Please instantiate a Candidate with your personal information
Candidate candidate = new Candidate(...);
evaluateDeveloper(candidate);
}
}
public void evaluateDeveloper(Candidate candidate) {
logger.info("Evaluating " + candidate.getName());
try {
if (candidate.isValid()){
Email email = new Email();
email.setContractor("ODEA SRL");
email.setLugarTrabajo(Address.MICROCENTRO);
email.setTo("rrhh@odeasrl.com.ar");
email.setFrom(candidate.getEmail());
email.setSubject("REF:JAVA");
email.setSalary(candidate.getSalary());
email.send();
logger.info("Te contactaremos a la brevedad. Gracias");
}
else
logger.info("No es lo que buscamos. Gracias");
}
catch (LocationException e) {
logger.info("El candidato debe vivir en Capital o Gran Buenos Aires. Gracias")
}
}
Autor: fbosch || Publicado: 26-06-2012