public class PropertiesProxy extends MultiLineProperties
maps
Constructor and Description |
---|
PropertiesProxy() |
PropertiesProxy(boolean utf8) |
PropertiesProxy(boolean utf8,
String... paths) |
PropertiesProxy(InputStream in) |
PropertiesProxy(Reader r) |
PropertiesProxy(String... paths) |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keys, keySet, load, load, print, print, put, putAll, remove, size, values
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public PropertiesProxy()
public PropertiesProxy(boolean utf8, String... paths)
public PropertiesProxy(boolean utf8)
public PropertiesProxy(String... paths)
public PropertiesProxy(InputStream in)
public PropertiesProxy(Reader r)
r
- 文本输入流public void setKeyIndex(Integer keyIndex)
public void setPaths(String... paths)
如果有重复的key,请务必注意加载的顺序!!
paths
- 需要加载的Properties文件路径public void setIgnoreResourceNotFound(boolean ignoreResourceNotFound)
public boolean has(String key)
key
- 键public PropertiesProxy set(String key, String val)
public boolean getBoolean(String key)
public boolean getBoolean(String key, boolean dfval)
public int getInt(String key)
public int getInt(String key, int defaultValue)
public long getLong(String key)
public long getLong(String key, long dfval)
public Collection<String> getValues()
public Properties toProperties()
public PropertiesProxy joinByKey(String key)
本函数假设你可能有下面的键值:
... files: path/to_a.properties path/to_b.properties #End files那么如果你调用
joinByKey("files");
属性文件的路径可以是磁盘全路径,或者在 CLASSPATH 里的路径
key
- 键public PropertiesProxy joinAndClose(Reader r)
r
- 文本输入流Copyright © 2019. All rights reserved.