@Override protected Player manageRow(String[] row) { Player player = playerRepository.getOne(getId(row)); Position pos = player.getPosition(); if (!pos.equals(getPosition(row))) { throw new RuntimeException("Invalid position for id"); } player.setGoals(getGoals(row)); return player; }
protected Position getPosition(String[] row) { return Position.valueOf(row[1]); }