package me.loganb1max.minions.util;

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

public class Replacer {

	private Map<String, String> replaceMap = new HashMap<>();

	public static Replacer create() {
		return new Replacer();
	}

	public Replacer add(final String key, final String value) {
		this.replaceMap.put(key, value);
		return this;
	}

	public String replace(String string) {
		for (Map.Entry<String, String> entry : this.replaceMap.entrySet()) {
			string = string.replaceAll(entry.getKey(), entry.getValue());
		}
		return string;
	}

}
