org.tbwork.anole.loader.context.impl.MatchCounter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of anole-loader Show documentation
Show all versions of anole-loader Show documentation
An awesome property or configuration loader for java.
The newest version!
package org.tbwork.anole.loader.context.impl;
import org.tbwork.anole.loader.util.AnoleLogger;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @program: anole-loader
* @description: Match counter
* @author: tommy.tb
* @create: 2019-03-06 09:40
**/
public class MatchCounter {
private static final Map patternConfigMap = new HashMap();
private static final Map counterMap = new HashMap();
public static void putConfigMap(String fullpathPattern, String userSpecifiedLocation ){
patternConfigMap.put(fullpathPattern, userSpecifiedLocation);
}
public static void setFoundFlag(String fullpathPattern){
counterMap.put(patternConfigMap.get(fullpathPattern), true);
}
public static void initialize(List userInputConfigLocations){
for(String location : userInputConfigLocations){
counterMap.put(location, false);
}
}
public static void checkNotExist(){
if(AnoleLogger.isDebugEnabled()){
for(Map.Entry item: counterMap.entrySet()){
if(item.getValue()!=null && !item.getValue())
AnoleLogger.debug("There is no matched file for '{}'", item.getKey());
}
}
}
}