package org.bench4q.agent.plugin.basic.UUID;

import org.bench4q.agent.plugin.Constructor;
import org.bench4q.agent.plugin.Parameter;
import org.bench4q.agent.plugin.ParameterBarn;
import org.bench4q.agent.plugin.Plugin;
import org.bench4q.agent.plugin.behavior.Behavior;
import org.bench4q.agent.plugin.behavior.BehaviorType;
import org.bench4q.agent.utils.Type.SupportTypes;

@Plugin("UUID")
public class UUID extends ParameterBarn {
	private java.util.UUID uuid;

	@Constructor
	public UUID(
			@Parameter(value = "testId", type = SupportTypes.Field) String testId) {
		super(testId);
		uuid = java.util.UUID.randomUUID();
	}

	@Behavior(value = "Next", type = BehaviorType.CONTROL_BEHAVIOR)
	public void next() {
		this.uuid = java.util.UUID.randomUUID();
	}

	@Override
	public String getValue(String var) {
		return this.uuid.toString();
	}

}
