// Path: spring-influxdb-orm/src/main/java/com/vgerbot/orm/influxdb/param/ParameterValue.java
// public class ParameterValue {
// 	private final Object value;
// 	private final ParameterSignature signature;
// 
// 	public ParameterValue(Object value, ParameterSignature signature) {
// 		super();
// 		this.value = value;
// 		this.signature = signature;
// 	}
// 
// 	public Object getValue() {
// 		return value;
// 	}
// 
// 	public ParameterSignature getSignature() {
// 		return signature;
// 	}
// 
// }
// 
// Path: spring-influxdb-orm/src/main/java/com/vgerbot/orm/influxdb/utils/StringUtils.java
// public static interface ReplaceCallback {
// 	String replace(String word, int index, String source);
// }


import java.util.Date;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import com.vgerbot.orm.influxdb.param.ParameterValue;
import com.vgerbot.orm.influxdb.utils.StringUtils.ReplaceCallback;
package com.vgerbot.orm.influxdb.utils;



public class CommandUtils {
	public static String parseCommand(String command, final Map<String, ParameterValue> parameters) {
		command = StringUtils.replace(command, "\\$\\{([^\\}]+)\\}", 1, new ReplaceCallback() {
			@Override
			public String replace(String word, int index, String source) {
				ParameterValue parameterValue = parameters.get(word);
				if (parameterValue == null || parameterValue.getValue() == null) {
					return "";
				}
// Path: spring-influxdb-orm/src/main/java/com/vgerbot/orm/influxdb/param/ParameterValue.java
// public class ParameterValue {
// 	private final Object value;
// 	private final ParameterSignature signature;
// 
// 	public ParameterValue(Object value, ParameterSignature signature) {
// 		super();
// 		this.value = value;
// 		this.signature = signature;
// 	}
// 
// 	public Object getValue() {
// 		return value;
// 	}
// 
// 	public ParameterSignature getSignature() {
// 		return signature;
// 	}
// 
// }
// 
// Path: spring-influxdb-orm/src/main/java/com/vgerbot/orm/influxdb/utils/StringUtils.java
// public static interface ReplaceCallback {
// 	String replace(String word, int index, String source);
// }


// Path: spring-influxdb-orm/src/main/java/com/vgerbot/orm/influxdb/utils/CommandUtils.java
import java.util.Date;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import com.vgerbot.orm.influxdb.param.ParameterValue;
import com.vgerbot.orm.influxdb.utils.StringUtils.ReplaceCallback;

package com.vgerbot.orm.influxdb.utils;



public class CommandUtils {
	public static String parseCommand(String command, final Map<String, ParameterValue> parameters) {
		command = StringUtils.replace(command, "\\$\\{([^\\}]+)\\}", 1, new ReplaceCallback() {
			@Override
			public String replace(String word, int index, String source) {
				ParameterValue parameterValue = parameters.get(word);
				if (parameterValue == null || parameterValue.getValue() == null) {
					return "";
				}
				Object value = parameterValue.getValue();