Browse Source

update: 新增方法

remotes/1611766341912730171/master
zjz1993 5 years ago
parent
commit
1e8dd0e3d9
  1. 12
      src/main/java/com/fanruan/api/conf/HolderKit.java

12
src/main/java/com/fanruan/api/conf/HolderKit.java

@ -5,6 +5,8 @@ import com.fanruan.api.conf.impl.ObjectColConf;
import com.fanruan.api.conf.impl.ObjectMapConf;
import com.fanruan.api.conf.impl.SimConf;
import com.fr.config.holder.Conf;
import com.fr.config.holder.factory.Holders;
import com.fr.config.holder.impl.ColConf;
import java.util.Collection;
import java.util.Map;
@ -88,4 +90,14 @@ public class HolderKit {
public static <K, V> ObjectMapConf<Map<K, V>> objMap(Map<K, V> map, Class<K> keyType, Class<V> valueType, boolean order) {
return new ObjectMapConf<>(map, keyType, valueType, order);
}
/**
* 创建一个collection类型的holder
* @param collection 值Collection类型
* @param valueType 值class类型
* @return collection类型的holder
* */
public static <K> ColConf<Collection<K>> collection(Collection<K> collection, Class<K> valueType) {
return Holders.collection(collection, valueType);
}
}

Loading…
Cancel
Save