// 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/config/RapidRouterConfiguration.java
// public interface RapidRouterConfiguration {
//     /**
//      * 配置路由策略
//      */
//     @NonNull
//     RapidRouterStrategy[] configRapidRouterStrategies();
// 
//     /**
//      * 配置路由映射
//      */
//     @Nullable
//     RapidRouterMapping[] configRapidRouterMappings();
// }
// 
// Path: library/src/main/java/com/wangjie/rapidrouter/core/strategy/RapidRouterStrategy.java
// public interface RapidRouterStrategy {
//     
//     void onRapidRouterMappings(RapidRouterMapping[] rapidRouterMappings);
// 
//     @Nullable
//     RouterTarget findRouterTarget(@NonNull Uri uri);
// 
// }
// 
// Path: library/src/main/java/com/wangjie/rapidrouter/core/strategy/RapidRouterStrategyRegular.java
// public class RapidRouterStrategyRegular extends RapidRouterAbstractStrategy {
//     /**
//      * HashMap<{uri reg}, {router target}>
//      */
//     private HashMap<String, RouterTarget> mapping;
// 
//     @Override
//     public void onRapidRouterMappings(RapidRouterMapping[] rapidRouterMappings) {
//         HashMap<String, RouterTarget> result = new HashMap<>();
//         for (RapidRouterMapping mapping : rapidRouterMappings) {
//             mapping.calcRegRouterMapper(result);
//         }
//         mapping = result;
//     }
// 
//     @Nullable
//     @Override
//     public RouterTarget findRouterTarget(@NonNull Uri uri) {
//         if (null == mapping) {
//             return null;
//         }
//         for (Map.Entry<String, RouterTarget> entry : mapping.entrySet()) {
//             if (uri.toString().matches(entry.getKey())) {
//                 return entry.getValue();
//             }
//         }
//         return null;
//     }
// }
// 
// Path: library/src/main/java/com/wangjie/rapidrouter/core/strategy/RapidRouterStrategySimple.java
// public class RapidRouterStrategySimple extends RapidRouterAbstractStrategy {
//     /**
//      * HashMap<{scheme}, HashMap<{host}, {router target}>>
//      */
//     private HashMap<String, HashMap<String, RouterTarget>> mapping;
// 
//     @Override
//     public void onRapidRouterMappings(RapidRouterMapping[] rapidRouterMappings) {
//         HashMap<String, HashMap<String, RouterTarget>> result = new HashMap<>();
//         for (RapidRouterMapping mapping : rapidRouterMappings) {
//             mapping.calcSimpleRouterMapper(result);
//         }
//         mapping = result;
//     }
// 
//     @Nullable
//     @Override
//     public RouterTarget findRouterTarget(@NonNull Uri uri) {
//         if (null == mapping) {
// //            throw new RapidRouterIllegalException("Maps not set in SimpleRouterStrategy.");
//             return null;
//         }
//         HashMap<String, RouterTarget> schemeMapper = mapping.get(uri.getScheme());
//         if (null != schemeMapper) {
//             return schemeMapper.get(uri.getHost());
//         }
//         return null;
//     }
// }


import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.wangjie.rapidrouter.api.annotations.RRConfig;
import com.wangjie.rapidrouter.core.RapidRouterMapping;
import com.wangjie.rapidrouter.core.config.RapidRouterConfiguration;
import com.wangjie.rapidrouter.core.strategy.RapidRouterStrategy;
import com.wangjie.rapidrouter.core.strategy.RapidRouterStrategyRegular;
import com.wangjie.rapidrouter.core.strategy.RapidRouterStrategySimple;
package com.wangjie.rapidrouter.example.router;



/**
 * Author: wangjie Email: tiantian.china.2@gmail.com Date: 2/9/17.
 */
@RRConfig(mappingName = "RapidRouterMappingHaquApp")
public class RouterConfiguration implements RapidRouterConfiguration {
    @NonNull
    @Override
    public RapidRouterStrategy[] configRapidRouterStrategies() {
        return new RapidRouterStrategy[]{
// 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/config/RapidRouterConfiguration.java
// public interface RapidRouterConfiguration {
//     /**
//      * 配置路由策略
//      */
//     @NonNull
//     RapidRouterStrategy[] configRapidRouterStrategies();
// 
//     /**
//      * 配置路由映射
//      */
//     @Nullable
//     RapidRouterMapping[] configRapidRouterMappings();
// }
// 
// Path: library/src/main/java/com/wangjie/rapidrouter/core/strategy/RapidRouterStrategy.java
// public interface RapidRouterStrategy {
//     
//     void onRapidRouterMappings(RapidRouterMapping[] rapidRouterMappings);
// 
//     @Nullable
//     RouterTarget findRouterTarget(@NonNull Uri uri);
// 
// }
// 
// Path: library/src/main/java/com/wangjie/rapidrouter/core/strategy/RapidRouterStrategyRegular.java
// public class RapidRouterStrategyRegular extends RapidRouterAbstractStrategy {
//     /**
//      * HashMap<{uri reg}, {router target}>
//      */
//     private HashMap<String, RouterTarget> mapping;
// 
//     @Override
//     public void onRapidRouterMappings(RapidRouterMapping[] rapidRouterMappings) {
//         HashMap<String, RouterTarget> result = new HashMap<>();
//         for (RapidRouterMapping mapping : rapidRouterMappings) {
//             mapping.calcRegRouterMapper(result);
//         }
//         mapping = result;
//     }
// 
//     @Nullable
//     @Override
//     public RouterTarget findRouterTarget(@NonNull Uri uri) {
//         if (null == mapping) {
//             return null;
//         }
//         for (Map.Entry<String, RouterTarget> entry : mapping.entrySet()) {
//             if (uri.toString().matches(entry.getKey())) {
//                 return entry.getValue();
//             }
//         }
//         return null;
//     }
// }
// 
// Path: library/src/main/java/com/wangjie/rapidrouter/core/strategy/RapidRouterStrategySimple.java
// public class RapidRouterStrategySimple extends RapidRouterAbstractStrategy {
//     /**
//      * HashMap<{scheme}, HashMap<{host}, {router target}>>
//      */
//     private HashMap<String, HashMap<String, RouterTarget>> mapping;
// 
//     @Override
//     public void onRapidRouterMappings(RapidRouterMapping[] rapidRouterMappings) {
//         HashMap<String, HashMap<String, RouterTarget>> result = new HashMap<>();
//         for (RapidRouterMapping mapping : rapidRouterMappings) {
//             mapping.calcSimpleRouterMapper(result);
//         }
//         mapping = result;
//     }
// 
//     @Nullable
//     @Override
//     public RouterTarget findRouterTarget(@NonNull Uri uri) {
//         if (null == mapping) {
// //            throw new RapidRouterIllegalException("Maps not set in SimpleRouterStrategy.");
//             return null;
//         }
//         HashMap<String, RouterTarget> schemeMapper = mapping.get(uri.getScheme());
//         if (null != schemeMapper) {
//             return schemeMapper.get(uri.getHost());
//         }
//         return null;
//     }
// }


// Path: app/src/main/java/com/wangjie/rapidrouter/example/router/RouterConfiguration.java
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.wangjie.rapidrouter.api.annotations.RRConfig;
import com.wangjie.rapidrouter.core.RapidRouterMapping;
import com.wangjie.rapidrouter.core.config.RapidRouterConfiguration;
import com.wangjie.rapidrouter.core.strategy.RapidRouterStrategy;
import com.wangjie.rapidrouter.core.strategy.RapidRouterStrategyRegular;
import com.wangjie.rapidrouter.core.strategy.RapidRouterStrategySimple;

package com.wangjie.rapidrouter.example.router;



/**
 * Author: wangjie Email: tiantian.china.2@gmail.com Date: 2/9/17.
 */
@RRConfig(mappingName = "RapidRouterMappingHaquApp")
public class RouterConfiguration implements RapidRouterConfiguration {
    @NonNull
    @Override
    public RapidRouterStrategy[] configRapidRouterStrategies() {
        return new RapidRouterStrategy[]{
                new RapidRouterStrategySimple(),