// Path: library/src/main/java/com/wangjie/rapidrouter/core/RapidRouterMapping.java
// public abstract class RapidRouterMapping {
// 
//     protected HashMap<String, RouterTarget> getEnsureMap(HashMap<String, HashMap<String, RouterTarget>> routerMapper, String key) {
//         HashMap<String, RouterTarget> map = routerMapper.get(key);
//         if (null == map) {
//             map = new HashMap<>();
//             routerMapper.put(key, map);
//         }
//         return map;
//     }
// 
//     public abstract HashMap<String, HashMap<String, RouterTarget>> calcSimpleRouterMapper(HashMap<String, HashMap<String, RouterTarget>> routerMapper);
// 
//     public abstract HashMap<String, RouterTarget> calcRegRouterMapper(HashMap<String, RouterTarget> routerMapper);
// 
// }
// 
// Path: library/src/main/java/com/wangjie/rapidrouter/core/target/RouterTarget.java
// public class RouterTarget {
//     private Class targetClass;
//     private HashMap<String, Class> params;
// 
//     public RouterTarget(Class targetClass, HashMap<String, Class> params) {
//         this.targetClass = targetClass;
//         this.params = params;
//     }
// 
//     public Class getTargetClass() {
//         return targetClass;
//     }
// 
//     public void setTargetClass(Class targetClass) {
//         this.targetClass = targetClass;
//     }
// 
//     public HashMap<String, Class> getParams() {
//         return params;
//     }
// 
//     public void setParams(HashMap<String, Class> params) {
//         this.params = params;
//     }
// }
// 
// Path: app/src/main/java/com/wangjie/rapidrouter/example/activity/AActivity.java
// @RRouter(
//         {
//                 @RRUri(uri = "rr://rapidrouter.a",
//                         params = {
//                                 @RRParam(name = "p_name"),
//                                 @RRParam(name = "p_age", type = int.class)
//                         }
//                 ),
//                 @RRUri(uri = "rr://rapidrouter_extra.a",
//                         params = {
//                                 @RRParam(name = "p_name"),
//                                 @RRParam(name = "p_age", type = int.class)
//                         }
//                 )
//         }
// )
// public class AActivity extends BaseActivity {
// 
//     private static final String TAG = AActivity.class.getSimpleName();
// 
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         getWindow().setBackgroundDrawable(new ColorDrawable(0xffaabbcc));
// 
//         Intent intent = getIntent();
// 
//         Log.i(TAG, "p_age: " + intent.getIntExtra("p_age", -1) + ", p_name: " + intent.getStringExtra("p_name"));
// 
//     }
// }
// 
// Path: app/src/main/java/com/wangjie/rapidrouter/example/activity/BActivity.java
// @RRUri(uri = "rr://rapidrouter.b", params = {
//         @RRParam(name = "id", type = long.class)
// })
// public class BActivity extends BaseActivity {
//     private static final String TAG = BActivity.class.getSimpleName();
// 
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         getWindow().setBackgroundDrawable(new ColorDrawable(0xffbbccaa));
//         Intent intent = getIntent();
//         Log.i(TAG, "intent: " + intent.getLongExtra("id", -1L));
//     }
// }
// 
// Path: app/src/main/java/com/wangjie/rapidrouter/example/activity/CActivity.java
// @RRUri(uri = "~((rr)|(sc))://wang.*jie\\.[cx].*", params = {
//         @RRParam(name = "paramOfCActivity", type = float.class)
// })
// public class CActivity extends BaseActivity {
//     private static final String TAG = BActivity.class.getSimpleName();
// 
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         getWindow().setBackgroundDrawable(new ColorDrawable(0xffccaabb));
// //        "adsb".matches("~((rr)|(sc))://wang.*jie\\.[cx].*");
//         Log.i(TAG, "paramOfCActivity: " + getIntent().getFloatExtra("paramOfCActivity", -1L));
//     }
// }


import com.wangjie.rapidrouter.core.RapidRouterMapping;
import com.wangjie.rapidrouter.core.target.RouterTarget;
import com.wangjie.rapidrouter.example.activity.AActivity;
import com.wangjie.rapidrouter.example.activity.BActivity;
import com.wangjie.rapidrouter.example.activity.CActivity;
import java.util.HashMap;
package com.wangjie.rapidrouter.example;



/**
 * Author: wangjie Email: tiantian.china.2@gmail.com Date: 2/8/17.
 */
public class ThisRapidRouterMapping extends RapidRouterMapping {
    @Override
    public HashMap<String, HashMap<String, RouterTarget>> calcSimpleRouterMapper(HashMap<String, HashMap<String, RouterTarget>> routerMapper) {
        HashMap<String, Class> params;

        // com.wangjie.rapidrouter.example.activity.AActivity
        params = new HashMap<>();
        params.put("p_name", String.class);
        params.put("p_age", int.class);
        getEnsureMap(routerMapper, "rr").put("rapidrouter.a", new RouterTarget(AActivity.class, params));

        // com.wangjie.rapidrouter.example.activity.AActivity
        params = new HashMap<>();
        params.put("p_name", String.class);
        params.put("p_age", int.class);
        getEnsureMap(routerMapper, "rr").put("rapidrouter_extra.a", new RouterTarget(AActivity.class, params));

        // com.wangjie.rapidrouter.example.activity.BActivity
        params = new HashMap<>();
        params.put("id", long.class);
// Path: library/src/main/java/com/wangjie/rapidrouter/core/RapidRouterMapping.java
// public abstract class RapidRouterMapping {
// 
//     protected HashMap<String, RouterTarget> getEnsureMap(HashMap<String, HashMap<String, RouterTarget>> routerMapper, String key) {
//         HashMap<String, RouterTarget> map = routerMapper.get(key);
//         if (null == map) {
//             map = new HashMap<>();
//             routerMapper.put(key, map);
//         }
//         return map;
//     }
// 
//     public abstract HashMap<String, HashMap<String, RouterTarget>> calcSimpleRouterMapper(HashMap<String, HashMap<String, RouterTarget>> routerMapper);
// 
//     public abstract HashMap<String, RouterTarget> calcRegRouterMapper(HashMap<String, RouterTarget> routerMapper);
// 
// }
// 
// Path: library/src/main/java/com/wangjie/rapidrouter/core/target/RouterTarget.java
// public class RouterTarget {
//     private Class targetClass;
//     private HashMap<String, Class> params;
// 
//     public RouterTarget(Class targetClass, HashMap<String, Class> params) {
//         this.targetClass = targetClass;
//         this.params = params;
//     }
// 
//     public Class getTargetClass() {
//         return targetClass;
//     }
// 
//     public void setTargetClass(Class targetClass) {
//         this.targetClass = targetClass;
//     }
// 
//     public HashMap<String, Class> getParams() {
//         return params;
//     }
// 
//     public void setParams(HashMap<String, Class> params) {
//         this.params = params;
//     }
// }
// 
// Path: app/src/main/java/com/wangjie/rapidrouter/example/activity/AActivity.java
// @RRouter(
//         {
//                 @RRUri(uri = "rr://rapidrouter.a",
//                         params = {
//                                 @RRParam(name = "p_name"),
//                                 @RRParam(name = "p_age", type = int.class)
//                         }
//                 ),
//                 @RRUri(uri = "rr://rapidrouter_extra.a",
//                         params = {
//                                 @RRParam(name = "p_name"),
//                                 @RRParam(name = "p_age", type = int.class)
//                         }
//                 )
//         }
// )
// public class AActivity extends BaseActivity {
// 
//     private static final String TAG = AActivity.class.getSimpleName();
// 
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         getWindow().setBackgroundDrawable(new ColorDrawable(0xffaabbcc));
// 
//         Intent intent = getIntent();
// 
//         Log.i(TAG, "p_age: " + intent.getIntExtra("p_age", -1) + ", p_name: " + intent.getStringExtra("p_name"));
// 
//     }
// }
// 
// Path: app/src/main/java/com/wangjie/rapidrouter/example/activity/BActivity.java
// @RRUri(uri = "rr://rapidrouter.b", params = {
//         @RRParam(name = "id", type = long.class)
// })
// public class BActivity extends BaseActivity {
//     private static final String TAG = BActivity.class.getSimpleName();
// 
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         getWindow().setBackgroundDrawable(new ColorDrawable(0xffbbccaa));
//         Intent intent = getIntent();
//         Log.i(TAG, "intent: " + intent.getLongExtra("id", -1L));
//     }
// }
// 
// Path: app/src/main/java/com/wangjie/rapidrouter/example/activity/CActivity.java
// @RRUri(uri = "~((rr)|(sc))://wang.*jie\\.[cx].*", params = {
//         @RRParam(name = "paramOfCActivity", type = float.class)
// })
// public class CActivity extends BaseActivity {
//     private static final String TAG = BActivity.class.getSimpleName();
// 
//     @Override
//     protected void onCreate(@Nullable Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         getWindow().setBackgroundDrawable(new ColorDrawable(0xffccaabb));
// //        "adsb".matches("~((rr)|(sc))://wang.*jie\\.[cx].*");
//         Log.i(TAG, "paramOfCActivity: " + getIntent().getFloatExtra("paramOfCActivity", -1L));
//     }
// }


// Path: app/src/main/java/com/wangjie/rapidrouter/example/ThisRapidRouterMapping.java
import com.wangjie.rapidrouter.core.RapidRouterMapping;
import com.wangjie.rapidrouter.core.target.RouterTarget;
import com.wangjie.rapidrouter.example.activity.AActivity;
import com.wangjie.rapidrouter.example.activity.BActivity;
import com.wangjie.rapidrouter.example.activity.CActivity;
import java.util.HashMap;

package com.wangjie.rapidrouter.example;



/**
 * Author: wangjie Email: tiantian.china.2@gmail.com Date: 2/8/17.
 */
public class ThisRapidRouterMapping extends RapidRouterMapping {
    @Override
    public HashMap<String, HashMap<String, RouterTarget>> calcSimpleRouterMapper(HashMap<String, HashMap<String, RouterTarget>> routerMapper) {
        HashMap<String, Class> params;

        // com.wangjie.rapidrouter.example.activity.AActivity
        params = new HashMap<>();
        params.put("p_name", String.class);
        params.put("p_age", int.class);
        getEnsureMap(routerMapper, "rr").put("rapidrouter.a", new RouterTarget(AActivity.class, params));

        // com.wangjie.rapidrouter.example.activity.AActivity
        params = new HashMap<>();
        params.put("p_name", String.class);
        params.put("p_age", int.class);
        getEnsureMap(routerMapper, "rr").put("rapidrouter_extra.a", new RouterTarget(AActivity.class, params));

        // com.wangjie.rapidrouter.example.activity.BActivity
        params = new HashMap<>();
        params.put("id", long.class);
        getEnsureMap(routerMapper, "rr").put("rapidrouter.b", new RouterTarget(BActivity.class, params));