Пример #1
0
  public TeamForm construct(Team team) {
    TeamForm result;

    result = new TeamForm();

    result.setId(team.getId());
    result.setMaxNumber(team.getMaxNumber());
    result.setName(team.getName());
    result.setCaptain(team.getCaptain());

    return result;
  }
Пример #2
0
  public Team reconstruct(TeamForm teamForm) {
    Team result;

    if (teamForm.getId() != 0) {
      result = findOne(teamForm.getId());

      checkPrincipal(result);
    } else {
      result = this.create();
    }

    result.setId(teamForm.getId());
    result.setMaxNumber(teamForm.getMaxNumber());
    result.setName(teamForm.getName());
    result.setCaptain(teamForm.getCaptain());

    return result;
  }