/*
 *    Copyright 2015 Benjamin Schmid, @bentolor
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package conf;

import controllers.GroceryListController;
import controllers.HelloWorldController;
import ninja.AssetsController;
import ninja.Router;
import ninja.application.ApplicationRoutes;

public class Routes implements ApplicationRoutes {

    @Override
    public void init(Router router) {
        // Hello world example with I18N
        router.GET().route("/hello").with(HelloWorldController.class, "helloWorld");

        // Grocery List application routes
        router.GET().route("/").with(GroceryListController.class, "index");
        router.GET().route("/list").with(GroceryListController.class, "getAllGroceryLists");
        router.GET().route("/list/{id: \\w+-\\w+-\\w+-\\w+-\\w+}").with(GroceryListController.class, "getGroceryList");
        router.DELETE().route("/list/{id}").with(GroceryListController.class, "deleteGroceryList");
        router.POST().route("/list").with(GroceryListController.class, "createGroceryList");
        router.PUT().route("/list/{id}").with(GroceryListController.class, "updateGroceryList");

        // Assets (pictures / javascript)
        router.GET().route("/assets/{fileName: .*}").with(AssetsController.class, "serveStatic");
    }

}

@@ -1035,25 +1035,18 @@
 ntroller
-.class, %22
+::
 helloWor
@@ -1047,17 +1047,16 @@
 lloWorld
-%22
 );%0A%0A    
@@ -1156,23 +1156,15 @@
 ller
-.class, %22
+::
 index
-%22
 );%0A 
@@ -1224,25 +1224,18 @@
 ntroller
-.class, %22
+::
 getAllGr
@@ -1244,17 +1244,16 @@
 eryLists
-%22
 );%0A     
@@ -1340,25 +1340,18 @@
 ntroller
-.class, %22
+::
 getGroce
@@ -1348,33 +1348,32 @@
 ::getGroceryList
-%22
 );%0A        route
@@ -1429,25 +1429,18 @@
 ntroller
-.class, %22
+::
 deleteGr
@@ -1440,33 +1440,32 @@
 eleteGroceryList
-%22
 );%0A        route
@@ -1514,25 +1514,18 @@
 ntroller
-.class, %22
+::
 createGr
@@ -1533,17 +1533,16 @@
 ceryList
-%22
 );%0A     
@@ -1603,25 +1603,18 @@
 ntroller
-.class, %22
+::
 updateGr
@@ -1622,17 +1622,16 @@
 ceryList
-%22
 );%0A%0A    
@@ -1746,17 +1746,10 @@
 ller
-.class, %22
+::
 serv
@@ -1755,17 +1755,16 @@
 veStatic
-%22
 );%0A    %7D

replace method strings with Java8 method references