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

com.atlassian.bamboo.specs.codegen.emitters.plan.branches.NotificationStrategyEmitter Maven / Gradle / Ivy

There is a newer version: 10.1.0
Show newest version
package com.atlassian.bamboo.specs.codegen.emitters.plan.branches;

import com.atlassian.bamboo.specs.api.codegen.CodeEmitter;
import com.atlassian.bamboo.specs.api.codegen.CodeGenerationContext;
import com.atlassian.bamboo.specs.api.codegen.CodeGenerationException;
import com.atlassian.bamboo.specs.api.model.plan.branches.PlanBranchManagementProperties;
import org.jetbrains.annotations.NotNull;

public class NotificationStrategyEmitter implements CodeEmitter {
    @NotNull
    @Override
    public String emitCode(@NotNull CodeGenerationContext context, @NotNull PlanBranchManagementProperties.NotificationStrategy value) throws CodeGenerationException {
        switch (value) {

            case NOTIFY_COMMITTERS:
                return ".notificationForCommitters()";
            case INHERIT:
                return ".notificationLikeParentPlan()";
            case NONE:
                return ".notificationDisabled()";
            default:
                throw new CodeGenerationException("Unrecognized notification strategy: " + value);
        }
    }
}








© 2015 - 2024 Weber Informatics LLC | Privacy Policy