tech.jhipster.lite.project.domain.history.ModuleParameters Maven / Gradle / Ivy
package tech.jhipster.lite.project.domain.history;
import java.util.HashMap;
import java.util.Map;
import tech.jhipster.lite.shared.collection.domain.JHipsterCollections;
import tech.jhipster.lite.shared.error.domain.Assert;
public record ModuleParameters(Map parameters) {
public static final ModuleParameters EMPTY = new ModuleParameters(Map.of());
public ModuleParameters(Map parameters) {
this.parameters = JHipsterCollections.immutable(parameters);
}
public Map get() {
return parameters();
}
public ModuleParameters merge(ModuleParameters other) {
Assert.notNull("other", other);
Map mergedParameters = new HashMap<>();
mergedParameters.putAll(parameters);
mergedParameters.putAll(other.parameters);
return new ModuleParameters(mergedParameters);
}
}