Ejemplo n.º 1
0
  /** Assigns the lead unit of the proposal to the given principal investigator */
  public void assignLeadUnit(ProposalPerson person, String unitNumber) {
    if (person.containsUnit(unitNumber)) {
      person.getUnit(unitNumber).setLeadUnit(true);
      return;
    }

    ProposalPersonUnit unit = createProposalPersonUnit(unitNumber, person);
    unit.setLeadUnit(true);
    addUnitToPerson(person, unit);
  }
Ejemplo n.º 2
0
  @Override
  public void addUnitToPerson(ProposalPerson person, ProposalPersonUnit unit) {
    if (unit == null) {
      throw new IllegalArgumentException("Cannot add null units to a ProposalPerson instance");
    }

    if (!person.containsUnit(unit.getUnitNumber())) {
      unit.setProposalPerson(person);

      person.addUnit(unit);
      unit.refreshReferenceObject("unit");
    }
  }