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

com.atlassian.bamboo.specs.codegen.emitters.trigger.ScheduledTriggerEmitter Maven / Gradle / Ivy

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

import com.atlassian.bamboo.specs.api.codegen.CodeGenerationContext;
import com.atlassian.bamboo.specs.api.codegen.CodeGenerationException;
import com.atlassian.bamboo.specs.builders.trigger.ScheduledDeploymentTrigger;
import com.atlassian.bamboo.specs.builders.trigger.ScheduledTrigger;
import com.atlassian.bamboo.specs.codegen.emitters.value.EntityPropertiesEmitter;
import com.atlassian.bamboo.specs.model.trigger.ScheduledTriggerProperties;
import org.jetbrains.annotations.NotNull;

public class ScheduledTriggerEmitter extends EntityPropertiesEmitter {
    @NotNull
    @Override
    public String emitCode(@NotNull final CodeGenerationContext context, @NotNull final ScheduledTriggerProperties entity) throws CodeGenerationException {
        switch (entity.getContainer()) {
            case PLAN:
                builderClass = ScheduledTrigger.class;
                break;
            case DEPLOYMENT:
                builderClass = ScheduledDeploymentTrigger.class;
                break;
            default:
                throw new IllegalStateException("Unknown type: " + entity.getContainer());
        }
        return super.emitCode(context, entity);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy