package com.atlassian.bitbucket.mesh.git.builder.config;

import com.atlassian.bitbucket.mesh.git.builder.GitProcess;
import com.atlassian.bitbucket.mesh.git.builder.GitProcessBuilderSupport;

import javax.annotation.Nonnull;
import java.util.List;

public interface GitConfigListBuilder extends GitProcessBuilderSupport<GitConfigListBuilder> {

    /**
     * @return a process which, when {@link GitProcess#run run}, will return a list of configured properties,
     *         which may be empty but never {@code null}
     */
    @Nonnull
    GitProcess<List<String>> build();

    /**
     * @param value {@code true} to only output names; otherwise, {@code false} to output names and values
     * @return {@code this}
     */
    @Nonnull
    GitConfigListBuilder nameOnly(boolean value);

    /**
     * @param value {@code} true to use newlines to separate names and values and {@code NUL} characters to
     *              terminate values; otherwise, {@code false} to use {@code =} to separate names and values
     *              and newlines to terminate values (the default)
     * @return {@code this}
     */
    @Nonnull
    GitConfigListBuilder nullTerminated(boolean value);
}
