class OutputFormatXmlAdapter extends XmlAdapter<ClientReportJobOutputFormatsWrapper, Set<OutputFormat>> {

    @Override
    public Set<OutputFormat> unmarshal(ClientReportJobOutputFormatsWrapper v) throws Exception {
        Set<OutputFormat> result = null;
        if (v != null && v.getFormats() != null && !v.getFormats().isEmpty()) {
            result = new HashSet<OutputFormat>();
            for (String currentValue : v.getFormats()) {
                OutputFormat outputFormat = OutputFormat.valueOf(currentValue);
                result.add(outputFormat);
            }
        }
        return result;
    }

}