@Override
    public void validate(Object target, Errors errors) {
        GameInfoWrapper gameInfo = (GameInfoWrapper) target;

        if(gameInfo.getMaxRounds() > MAX_ROUND_NUM_VALUE) {
            errors.rejectValue("maxRounds", "Max.gameInfoWrapper.maxRounds", new Integer[]{MAX_ROUND_NUM_VALUE}, "");
        }

        if(gameInfo.getMaxRounds() < MIN_ROUND_NUM_VALUE) {
            errors.rejectValue("maxRounds", "Min.gameInfoWrapper.maxRounds", new Integer[]{MIN_ROUND_NUM_VALUE}, "");
        }

        for(String name : gameInfo.getPlayersInfoMap().keySet()) {
            if(gameInfo.getPlayersInfoMap().get(name) > MAX_PLAYER_COUNT) {
                errors.rejectValue("playersInfoMap", "Max.gameInfoWrapper.playerNumber", new Integer[]{MAX_PLAYER_COUNT}, "");
            }

            if(gameInfo.getPlayersInfoMap().get(name) < MIN_PLAYER_COUNT) {
                errors.rejectValue("playersInfoMap", "Min.gameInfoWrapper.playerNumber", new Integer[]{MIN_PLAYER_COUNT}, "");
            }
        }


    }