All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.jhipster.lite.project.domain.history.ModuleParameters Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
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);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy