package me.coley.recaf.decompile;

import me.coley.recaf.workspace.Workspace;

import java.util.Map;

/**
 * Decompiler base.
 *
 * @author Matt.
 */
public abstract class Decompiler<OptionType> {
	private final Map<String, OptionType> defaultOptions = generateDefaultOptions();
	private Map<String, OptionType> options = defaultOptions;

	/**
	 * @return Map of the current options.
	 */
	public Map<String, OptionType> getOptions() {
		return options;
	}

	/**
	 * @param options
	 * 		Map of the options to use.
	 */
	public void setOptions(Map<String, OptionType> options) {
		this.options = options;
	}

	/**
	 * @return Map of the default decompiler options.
	 */
	public Map<String, OptionType> getDefaultOptions() {
		return defaultOptions;
	}

	/**
	 * @return Map of the default decompiler options.
	 */
	protected abstract Map<String, OptionType> generateDefaultOptions();

	/**
	 * @param workspace
	 * 		Workspace to pull classes from.
	 * @param name
	 * 		Name of the class to decompile.
	 *
	 * @return Decompiled text of the class.
	 */
	public abstract String decompile(Workspace workspace, String name);
}
@@ -89,19 +89,17 @@
 va.util.
-Map
+*
 ;%0A%0A/**%0A 
@@ -244,16 +244,44 @@
 tions = 
+Collections.unmodifiableMap(
 generate
@@ -296,16 +296,17 @@
 ptions()
+)
 ;%0A%09priva
@@ -342,16 +342,30 @@
 tions = 
+new HashMap%3C%3E(
 defaultO
@@ -370,16 +370,17 @@
 tOptions
+)
 ;%0A%0A%09/**%0A

Make default options map unmodifiable