package org.bench4q.agent.scenario;

import java.util.List;

import org.bench4q.agent.scenario.dfa.DFA;
import org.bench4q.agent.scenario.dfa.ParamPart;

public class Parameter {
	private String key;
	private String value;
	private ParamPart[] paramParts;

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public ParamPart[] getParamParts() {
		return paramParts;
	}

	private void setParamParts(ParamPart[] paramParts) {
		this.paramParts = paramParts;
	}

	public Parameter() {
	}

	public Parameter(String key, String value) {
		this();
		this.setKey(key);
		this.setValue(value);
	}

	public void compileToGenerateParts() {
		List<ParamPart> paramParts = DFA.resolveMaltipleParamPart(this
				.getValue());
		this.setParamParts(paramParts.toArray(new ParamPart[paramParts.size()]));
	}
}
