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

com.lionbridge.content.sdk.models.ServiceList Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package com.lionbridge.content.sdk.models;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;

import java.util.ArrayList;
import java.util.List;

@JacksonXmlRootElement(localName="Services")
public class ServiceList {
	@JacksonXmlElementWrapper(useWrapping = false)
	@JacksonXmlProperty(localName="Service")
	private List services = new ArrayList<>();

	public List getServices() {
		return services;
	}

	public void setServices(List services) {
		this.services = services;
	}

	public String toXmlString() {
		StringBuilder xmlString = new StringBuilder();
		if(null != this.services) {
			xmlString.append("");
			for(Service printService : this.services) {
				xmlString.append("\n\t");
				xmlString.append(printService.toDebugString());
			}
			xmlString.append("");
		}
		return xmlString.toString();
	}

	public List getValidServicesForExtensions(final List extensions) {
		List validServices = new ArrayList<>();
		if (null != this.services && !this.services.isEmpty()) {
			for (Service service : this.services) {
				if (0 < service.getValidInputs().numberActiveExtensionsSupported(extensions)) {
					validServices.add(service);
				}
			}
		}
		return validServices;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy