package com.javahonk.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
public class SpringMVCController {
	
	private static final Logger logger = Logger.getLogger(SpringMVCController.class);
	
	@RequestMapping(value = "/consumeJSONString")
	public @ResponseBody String consumeJSONString() {	
		logger.debug("Inside consumeJSONString");
		return "Java Honk";	
	}
	
	@RequestMapping(value = "/consumeJSONList")
	public @ResponseBody List<String> consumeJSONList() {	
		
		List<String> value = new ArrayList<String>();
		value.add("Java");
		value.add("Honk");

		return value;	
	}
	
	@RequestMapping(value = "/consumeJSONMap")
	public @ResponseBody Map<String,String> consumeJSONMap() {	
		
		Map<String,String> value = new HashMap<String,String>();
		value.put("firstName", "Java");
		value.put("lastName", "Honk");

		return value;	
	}

}
