Refactor compiler arguments to configuration conversion:
extract into independent functions, rearrange logic
This commit is contained in:
@@ -73,6 +73,12 @@ public class CompilerConfiguration {
|
||||
map.put(key.ideaKey, value);
|
||||
}
|
||||
|
||||
public <T> void putIfNotNull(@NotNull CompilerConfigurationKey<T> key, @Nullable T value) {
|
||||
if (value != null) {
|
||||
put(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
public <T> void add(@NotNull CompilerConfigurationKey<List<T>> key, @NotNull T value) {
|
||||
checkReadOnly();
|
||||
Key<List<T>> ideaKey = key.ideaKey;
|
||||
@@ -89,8 +95,10 @@ public class CompilerConfiguration {
|
||||
data.put(key, value);
|
||||
}
|
||||
|
||||
public <T> void addAll(@NotNull CompilerConfigurationKey<List<T>> key, @NotNull Collection<T> values) {
|
||||
addAll(key, getList(key).size(), values);
|
||||
public <T> void addAll(@NotNull CompilerConfigurationKey<List<T>> key, @Nullable Collection<T> values) {
|
||||
if (values != null) {
|
||||
addAll(key, getList(key).size(), values);
|
||||
}
|
||||
}
|
||||
|
||||
public <T> void addAll(@NotNull CompilerConfigurationKey<List<T>> key, int index, @NotNull Collection<T> values) {
|
||||
|
||||
Reference in New Issue
Block a user