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

com.regnosys.rosetta.translate.TranslatorOptionsGroup Maven / Gradle / Ivy

There is a newer version: 11.25.1
Show newest version
package com.regnosys.rosetta.translate;

import java.util.HashMap;
import java.util.Map;

public class TranslatorOptionsGroup {
	private Map options;
	private String defaultTranslator;
	
	public Map getOptions() {
		return options;
	}
	public void setOptions(Map options) {
		this.options = options;
	}
	public String getDefaultTranslator() {
		return defaultTranslator;
	}
	public void setDefaultTranslator(String defaultTranslator) {
		this.defaultTranslator = defaultTranslator;
	}
	
	public TranslatorOptionsGroup mergeGroups(TranslatorOptionsGroup toMerge) {
		if (defaultTranslator!=null && toMerge.defaultTranslator!=null && !defaultTranslator.equals(toMerge.defaultTranslator)) {
			throw new IllegalArgumentException("Cannot merge two ingestion groups with different defaults");
		}
		TranslatorOptionsGroup result = new TranslatorOptionsGroup();
		result.defaultTranslator = defaultTranslator==null?toMerge.defaultTranslator:defaultTranslator;
		Map resultOptions = new HashMap<>(options);
		resultOptions.putAll(toMerge.getOptions());
		result.setOptions(resultOptions);
		return result;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy