// Path: web-api/SparkHelloWorld/src/main/java/com/sample/interfaces/SumFunctionalI.java
// public interface SumFunctionalI {
// 
//     /**
//      * Returns the sum of two {@link Number}s
//      * Implementation has been kept default to maintain the functional state of the interface
//      *
//      * @param numA
//      * @param numB
//      * @return
//      */
//     default Number sumNumber(Number numA, Number numB) {
//         return numA.doubleValue() + numB.doubleValue();
//     }
// 
//     /**
//      * The functional method.
//      * To concatenate two strings
//      *
//      * @param tokenA
//      * @param tokenB
//      * @return
//      */
//     public String concatStrings(String tokenA, String tokenB);
// 
// }


import com.sample.interfaces.SumFunctionalI;
import org.apache.log4j.Logger;
import java.util.Map;
import static spark.Spark.get;
package com.sample.get;




public class GetRequests {

    private static final Logger log = Logger.getLogger(GetRequests.class);

    /**
     * Sample get request to print a greeting on the browser
     */
    public static void greet() {
        get("/helloWorld", (arg0, arg1) -> "This is from the Get method. Hello world");
    }

    /**
     * Get request to print the query parameters passed
     * Sample request can look like <code>http://localhost:4567/helloWorld2?a=1,2&b=a&a=5</code>
     */
    public static void getQueryParams() {
        String result = "";
        get("/helloWorld2", (req, res) -> {
            Map<String, String[]> queryParamsMap = req.queryMap().toMap();
            for (String p : queryParamsMap.keySet()) {
                String[] vals = queryParamsMap.get(p);
                for (String val : vals) {
                    log.info(p + "::" + val);
                }

            }
            return result;
        });
    }

    public static void add() {
        get("/sumop", (req, res) -> {
// Path: web-api/SparkHelloWorld/src/main/java/com/sample/interfaces/SumFunctionalI.java
// public interface SumFunctionalI {
// 
//     /**
//      * Returns the sum of two {@link Number}s
//      * Implementation has been kept default to maintain the functional state of the interface
//      *
//      * @param numA
//      * @param numB
//      * @return
//      */
//     default Number sumNumber(Number numA, Number numB) {
//         return numA.doubleValue() + numB.doubleValue();
//     }
// 
//     /**
//      * The functional method.
//      * To concatenate two strings
//      *
//      * @param tokenA
//      * @param tokenB
//      * @return
//      */
//     public String concatStrings(String tokenA, String tokenB);
// 
// }


// Path: web-api/SparkHelloWorld/src/main/java/com/sample/get/GetRequests.java
import com.sample.interfaces.SumFunctionalI;
import org.apache.log4j.Logger;
import java.util.Map;
import static spark.Spark.get;

package com.sample.get;




public class GetRequests {

    private static final Logger log = Logger.getLogger(GetRequests.class);

    /**
     * Sample get request to print a greeting on the browser
     */
    public static void greet() {
        get("/helloWorld", (arg0, arg1) -> "This is from the Get method. Hello world");
    }

    /**
     * Get request to print the query parameters passed
     * Sample request can look like <code>http://localhost:4567/helloWorld2?a=1,2&b=a&a=5</code>
     */
    public static void getQueryParams() {
        String result = "";
        get("/helloWorld2", (req, res) -> {
            Map<String, String[]> queryParamsMap = req.queryMap().toMap();
            for (String p : queryParamsMap.keySet()) {
                String[] vals = queryParamsMap.get(p);
                for (String val : vals) {
                    log.info(p + "::" + val);
                }

            }
            return result;
        });
    }

    public static void add() {
        get("/sumop", (req, res) -> {
            SumFunctionalI functionalI = (String tokenA, String tokenB) -> tokenA + tokenB;