com.lionbridge.content.sdk.models.ServiceList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of liox-content-sdk-java Show documentation
Show all versions of liox-content-sdk-java Show documentation
Client for Lionbridge Ondemand API
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;
}
}