All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ats.generator.variables.ApiData Maven / Gradle / Ivy

The newest version!
package com.ats.generator.variables;

import com.ats.executor.ActionTestScript;
import com.ats.script.Script;
import com.google.gson.JsonObject;

public class ApiData extends CalculatedProperty {
	
	public ApiData() {}
	
	public ApiData(String key, CalculatedValue calculatedValue) {
		super(key, calculatedValue);
	}

	public ApiData(Script script, String s) {
		super(script, s);
	}

	@Override
	public String getJavaCode() {
		return ActionTestScript.JAVA_PROPERTY_FUNCTION_NAME + "(\"" + getName() + "\", " + getValue().getJavaCode() + ")";
	}
	
	public JsonObject getJson() {
		final JsonObject element = new JsonObject();
		element.addProperty(getName(), getValue().getSafeCalculated());
		return element;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy