com.atlassian.bamboo.specs.codegen.emitters.fragment.VarargArgumentSetterEmitter Maven / Gradle / Ivy
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 com.atlassian.bamboo.specs.codegen.emitters.CodeGenerationUtils;
import com.atlassian.bamboo.specs.codegen.emitters.value.ValueEmitterFactory;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
/**
* Default code generator for any {@link Iterable} field of {@link com.atlassian.bamboo.specs.api.model.EntityProperties} instance.
*/
public class VarargArgumentSetterEmitter implements CodeEmitter> {
final String methodName;
public VarargArgumentSetterEmitter(final String methodName) {
this.methodName = methodName;
}
/**
* Generates invocation of a setter method with a variable length argument list.
*/
@NotNull
@Override
public String emitCode(@NotNull final CodeGenerationContext context, @NotNull final Iterable