public static V1ServiceDescription toV1ServiceDescription(ServiceDescription serviceDescription)
{
if (serviceDescription != null)
{
V1ServiceDescription result = new V1ServiceDescription();
result.setRegistrationPropertyDescription(toV1ModelDescription(serviceDescription.getRegistrationPropertyDescription()));
result.setRequiresInitCookie(toV1CookieProtocol(serviceDescription.getRequiresInitCookie()));
result.setRequiresRegistration(serviceDescription.isRequiresRegistration());
result.setResourceList(toV1ResourceList(serviceDescription.getResourceList()));
List<V1ItemDescription> modes = WSRPUtils.transform(serviceDescription.getCustomModeDescriptions(), ITEMDESCRIPTION);
if (modes != null)
{
result.getCustomModeDescriptions().addAll(modes);
}
List<V1ItemDescription> windowStates = WSRPUtils.transform(serviceDescription.getCustomWindowStateDescriptions(), ITEMDESCRIPTION);
if (windowStates != null)
{
result.getCustomWindowStateDescriptions().addAll(windowStates);
}
List<V1Extension> extensions = WSRPUtils.transform(serviceDescription.getExtensions(), EXTENSION);
if (extensions != null)
{
result.getExtensions().addAll(extensions);
}
List<String> locales = result.getLocales();
if (ParameterValidation.existsAndIsNotEmpty(locales))
{
result.getLocales().addAll(locales);
}
List<V1ItemDescription> userCategories = WSRPUtils.transform(serviceDescription.getUserCategoryDescriptions(), ITEMDESCRIPTION);
if (userCategories != null)
{
result.getUserCategoryDescriptions().addAll(userCategories);
}
List<V1PortletDescription> portletDescriptions = WSRPUtils.transform(serviceDescription.getOfferedPortlets(), PORTLETDESCRIPTION);
if (portletDescriptions != null)
{
result.getOfferedPortlets().addAll(portletDescriptions);
}
return result;
}
else