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

com.atlassian.bamboo.specs.util.BambooSpecSerializer Maven / Gradle / Ivy

There is a newer version: 10.1.0
Show newest version
package com.atlassian.bamboo.specs.util;

import com.atlassian.bamboo.specs.api.builders.EntityPropertiesBuilder;
import com.atlassian.bamboo.specs.api.model.EntityProperties;
import com.atlassian.bamboo.specs.api.util.EntityPropertiesBuilders;

import java.io.Writer;

/**
 * Wrapper to convert bamboo spec object to String.
 */
public final class BambooSpecSerializer {
    private BambooSpecSerializer() {
    }

    public static  String dump(final EntityPropertiesBuilder entity) {
        final T entityProperties = EntityPropertiesBuilders.build(entity);
        final BambooSpecProperties bambooSpecProperties = new BambooSpecProperties(entityProperties);
        return IsolatedYamlizator.execute(bambooSpecProperties);
    }

    public static  void dump(final EntityPropertiesBuilder entity, final Writer writer) {
        final T entityProperties = EntityPropertiesBuilders.build(entity);
        final BambooSpecProperties bambooSpecProperties = new BambooSpecProperties(entityProperties);
        Yamlizator.getYaml().dump(bambooSpecProperties, writer);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy