class SdxRepairSettings {

    public static SdxRepairSettings from(SdxRepairRequest request) {
        if (StringUtils.isNotBlank(request.getHostGroupName()) && CollectionUtils.isNotEmpty(request.getHostGroupNames())) {
            throw new BadRequestException("Please send only one hostGroupName in the 'hostGroupName' field " +
                    "or multiple hostGroups in the 'hostGroupNames' fields");
        }
        SdxRepairSettings settings = new SdxRepairSettings();
        if (Strings.isNotEmpty(request.getHostGroupName())) {
            settings.hostGroupNames = List.of(request.getHostGroupName());
        } else {
            settings.hostGroupNames = request.getHostGroupNames();
        }
        return settings;
    }

    private  SdxRepairSettings();

}