io.quarkus.devtools.codestarts.core.CodestartData Maven / Gradle / Ivy
package io.quarkus.devtools.codestarts.core;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import io.quarkus.devtools.codestarts.Codestart;
import io.quarkus.devtools.codestarts.CodestartType;
import io.quarkus.devtools.codestarts.core.CodestartSpec.CodestartDep;
import io.quarkus.devtools.codestarts.utils.NestedMaps;
public final class CodestartData {
public static final String INPUT_BASE_CODESTART_KEY_PREFIX = "input.base-codestart.";
public static final String INPUT_BASE_CODESTARTS_KEY = "input.base-codestarts";
public static final String INPUT_EXTRA_CODESTARTS_KEY = "input.extra-codestarts";
private CodestartData() {
}
public static Optional getInputCodestartForType(final Map data, final CodestartType type) {
return NestedMaps.getValue(data, INPUT_BASE_CODESTART_KEY_PREFIX + type.toString().toLowerCase());
}
public static Optional getBuildtool(final Map data) {
return getInputCodestartForType(data, CodestartType.BUILDTOOL);
}
public static Map buildCodestartData(final Codestart codestart, final String languageName,
final Map data) {
final Optional