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

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

There is a newer version: 2.9.3
Show newest version
package com.shopify.model.adapters;

import java.util.Collection;
import java.util.stream.Collectors;

import javax.xml.bind.annotation.adapters.XmlAdapter;

import org.apache.commons.lang3.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 - 2025 Weber Informatics LLC | Privacy Policy