All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dft.api.shopify.model.adapters.EscapedStringsAdapter Maven / Gradle / Ivy

The newest version!
package com.dft.api.shopify.model.adapters;

import java.util.Collection;
import java.util.stream.Collectors;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import org.apache.commons.text.StringEscapeUtils;

public class EscapedStringsAdapter extends XmlAdapter, Collection> {

	@Override
	public Collection unmarshal(final Collection escapedStrings) throws Exception {
		return (escapedStrings == null) ? null
				: escapedStrings.stream().map(StringEscapeUtils::unescapeHtml4).collect(Collectors.toList());
	}

	@Override
	public Collection marshal(final Collection unescapedStrings) throws Exception {
		return unescapedStrings;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy