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

com.atlassian.bamboo.specs.codegen.emitters.fragment.SecretSetterEmitter Maven / Gradle / Ivy

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

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 org.jetbrains.annotations.NotNull;

public class SecretSetterEmitter implements CodeEmitter {
    public static final String SECRET_PLACEHOLDER = "/* PUT YOUR SENSITIVE INFORMATION HERE*/";
    final String methodName;

    public SecretSetterEmitter(final String methodName) {
        this.methodName = methodName;
    }

    @NotNull
    public String emitCode(@NotNull final CodeGenerationContext context, @NotNull final Object argument) throws CodeGenerationException {
        return String.format(".%s(%s)", methodName, SECRET_PLACEHOLDER);
    }
}