public static void assertComponentTypes( Map<String, ComponentTemplate<?>> components) { assertNotEmpty(components, "components"); Set<String> yamlLiterals = Stream.of(ResourceType.getValues()) .map(type -> type.getContentType()) .collect(Collectors.toSet()); components.forEach((componentName, component) -> { if (!yamlLiterals.contains(component.type)) { String errorMessage = String.format("Component '%s' has an unsupported type '%s'", componentName, component.type); throw new LocalizableValidationException(errorMessage, "compute.template.components.unsupported.type", componentName, component.type); } }); }