Exemplo n.º 1
0
 public static BasePersonImpl convertToBasePerson(Person person) {
   BasePersonImpl newPerson = new BasePersonImpl(person.getId());
   PersonUtils.setAge(newPerson, PersonUtils.getAge(person));
   PersonUtils.setCarAvail(newPerson, PersonUtils.getCarAvail(person));
   PersonUtils.setEmployed(newPerson, PersonUtils.isEmployed(person));
   PersonUtils.setLicence(newPerson, PersonUtils.getLicense(person));
   PersonUtils.setSex(newPerson, PersonUtils.getSex(person));
   for (Plan plan : person.getPlans()) if (!PersonUtils.isSelected(plan)) newPerson.addPlan(plan);
   BasePlanImpl.convertToBasePlan(newPerson, person.getSelectedPlan());
   return newPerson;
 }
Exemplo n.º 2
0
 // Static methods
 public static BasePersonImpl getBasePerson(
     boolean fixedTypes,
     String[] types,
     Person person,
     TripRouter tripRouter,
     ActivityFacilities facilities) {
   BasePersonImpl newPerson = new BasePersonImpl(person.getId());
   PersonUtils.setAge(newPerson, PersonUtils.getAge(person));
   PersonUtils.setCarAvail(newPerson, PersonUtils.getCarAvail(person));
   PersonUtils.setEmployed(newPerson, PersonUtils.isEmployed(person));
   PersonUtils.setLicence(newPerson, PersonUtils.getLicense(person));
   PersonUtils.setSex(newPerson, PersonUtils.getSex(person));
   PlanImpl plan = (PlanImpl) person.getSelectedPlan();
   newPerson.addPlan(plan);
   BasePlanImpl.createBasePlan(fixedTypes, types, newPerson, plan, tripRouter, facilities);
   return newPerson;
 }