package com.google.sps.agents;
 
// Imports the Google Cloud client library
import com.google.cloud.dialogflow.v2.QueryInput;
import com.google.cloud.dialogflow.v2.QueryResult;
import com.google.protobuf.Struct;
import com.google.protobuf.Value;
import com.google.sps.data.Output;
import com.google.sps.agents.Agent;
import java.io.IOException;
import java.util.Map;
 
/**
 * Currency Agent
 */
public class Currency implements Agent {
	private final String intentName;
	private String currencyFrom;
	private String currencyTo;
	private Double amount;
	private String fulfillment = null;;
	private String diplay = null;
	private String redirect = null;

	public Currency(String intentName, Map<String, Value> parameters) {
		this.intentName = intentName;
		setParameters(parameters);
	}

	@Override 
	public void setParameters(Map<String, Value> parameters) {
		currencyFrom = parameters.get("currency-from").getStringValue();
		currencyTo = parameters.get("currency-to").getStringValue();
		amount = parameters.get("amount").getNumberValue();

		fulfillment = "Redirecting for conversion";
		String baseURL = "http://www.google.com/search?q=";
		String endURL = String.join("+", "Convert", String.valueOf(amount), currencyFrom, "to", currencyTo); 
		redirect = baseURL + endURL;
	}

	@Override
	public String getOutput() {
		return fulfillment;
	}

	@Override
	public String getDisplay() {
		return display;
	}

	@Override
	public String getRedirect() {
		return redirect;
	}
}

@@ -388,16 +388,17 @@
 ent%0A */%0A
+%0A
 public c
@@ -430,17 +430,18 @@
 Agent %7B%0A
-%09
+  
 private 
@@ -465,17 +465,18 @@
 ntName;%0A
-%09
+  
 private 
@@ -496,17 +496,18 @@
 cyFrom;%0A
-%09
+  
 private 
@@ -525,17 +525,18 @@
 encyTo;%0A
-%09
+  
 private 
@@ -550,17 +550,18 @@
 amount;%0A
-%09
+  
 private 
@@ -588,17 +588,18 @@
  null;;%0A
-%09
+  
 private 
@@ -620,17 +620,18 @@
 = null;%0A
-%09
+  
 private 
@@ -655,17 +655,18 @@
  null;%0A%0A
-%09
+  
 public C
@@ -726,17 +726,18 @@
 ers) %7B%0A%09
-%09
+  
 this.int
@@ -759,17 +759,18 @@
 tName;%0A%09
-%09
+  
 setParam
@@ -788,21 +788,23 @@
 eters);%0A
-%09%7D%0A%0A%09
+  %7D%0A%0A  
 @Overrid
@@ -806,17 +806,18 @@
 erride %0A
-%09
+  
 public v
@@ -868,17 +868,18 @@
 ers) %7B%0A%09
-%09
+  
 currency
@@ -936,17 +936,18 @@
 lue();%0A%09
-%09
+  
 currency
@@ -1000,17 +1000,18 @@
 lue();%0A%09
-%09
+  
 amount =
@@ -1056,17 +1056,18 @@
 ue();%0A%0A%09
-%09
+  
 fulfillm
@@ -1099,25 +1099,26 @@
 nversion%22;%0A%09
-%09
+  
 String baseU
@@ -1158,17 +1158,18 @@
 h?q=%22;%0A%09
-%09
+  
 String e
@@ -1263,17 +1263,18 @@
 yTo); %0A%09
-%09
+  
 redirect
@@ -1294,21 +1294,23 @@
 endURL;%0A
-%09%7D%0A%0A%09
+  %7D%0A%0A  
 @Overrid
@@ -1303,33 +1303,34 @@
  %7D%0A%0A  @Override%0A
-%09
+  
 public String ge
@@ -1338,25 +1338,26 @@
 Output() %7B%0A%09
-%09
+  
 return fulfi
@@ -1364,21 +1364,23 @@
 llment;%0A
-%09%7D%0A%0A%09
+  %7D%0A%0A  
 @Overrid
@@ -1373,33 +1373,34 @@
  %7D%0A%0A  @Override%0A
-%09
+  
 public String ge
@@ -1409,25 +1409,26 @@
 isplay() %7B%0A%09
-%09
+  
 return displ
@@ -1435,13 +1435,15 @@
 ay;%0A
-%09%7D%0A%0A%09
+  %7D%0A%0A  
 @Ove
@@ -1448,17 +1448,18 @@
 verride%0A
-%09
+  
 public S
@@ -1481,17 +1481,18 @@
 ct() %7B%0A%09
-%09
+  
 return r
@@ -1500,13 +1500,14 @@
 direct;%0A
-%09
+  
 %7D%0A%7D%0A

Update Currency.java