Interface BambooYamlSpecsService
- All Known Implementing Classes:
BambooYamlSpecsServiceImpl
public interface BambooYamlSpecsService
Utility service for working with Bamboo Specs YAML files.
-
Method Summary
Modifier and TypeMethodDescription@NotNull BambooYamlEntityTypedetermineEntityType(@NotNull Map<String, Object> yamlStructure) Determine YAML entity type which is defined in a given YAML document.@NotNull BambooYamlVersiondetermineVersion(@NotNull Map<String, Object> yamlStructure) Determine YAML version in a document from the given YAML structure.splitDocuments(@NotNull String yamlString, @Nullable Path yamlDirectory) Splits the givenyamlStringinto multiple documents, converting them toMapentities.
-
Method Details
-
splitDocuments
@NotNull @NotNull List<Map<String,Object>> splitDocuments(@NotNull @NotNull String yamlString, @Nullable @Nullable Path yamlDirectory) throws YamlSpecsValidationException Splits the givenyamlStringinto multiple documents, converting them toMapentities. No additional processing of the YAML is occurring in this step.- Parameters:
yamlString- YAML string representing an entire YAML file, may define multiple documentsyamlDirectory- YAML directory in case of using include files- Returns:
- a list of Java
Maps created by parsing each YAML document - Throws:
YamlSpecsValidationException- if the YAML string is invalid
-
determineVersion
@NotNull @NotNull BambooYamlVersion determineVersion(@NotNull @NotNull Map<String, Object> yamlStructure) throws YamlSpecsValidationExceptionDetermine YAML version in a document from the given YAML structure.- Parameters:
yamlStructure- structure of a parsed YAML document- Returns:
- version of the YAML document
- Throws:
YamlSpecsValidationException- if the version is invalid
-
determineEntityType
@NotNull @NotNull BambooYamlEntityType determineEntityType(@NotNull @NotNull Map<String, Object> yamlStructure) throws YamlSpecsValidationExceptionDetermine YAML entity type which is defined in a given YAML document.- Parameters:
yamlStructure- structure of a parsed YAML document- Returns:
- entity type defined in the YAML document
- Throws:
YamlSpecsValidationException- if the entity type can't be determined
-