mirror of
https://github.com/lightbend/config.git
synced 2025-03-25 16:50:40 +08:00
Rename getMemorySizeInBytesList to getBytesList to match getBytes
This commit is contained in:
parent
4f3a91fd86
commit
a840c2599d
@ -163,11 +163,11 @@ public interface Config extends ConfigMergeable {
|
||||
* with your module. It's best to allow the modules owning those paths to
|
||||
* validate them. Also, if every module validates only its own stuff, there
|
||||
* isn't as much redundant work being done.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* If no paths are specified in <code>checkValid()</code>'s parameter list,
|
||||
* validation is for the entire config.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* If you specify paths that are not in the reference config, those paths
|
||||
* are ignored. (There's nothing to validate.)
|
||||
@ -465,7 +465,7 @@ public interface Config extends ConfigMergeable {
|
||||
|
||||
List<? extends Object> getAnyRefList(String path);
|
||||
|
||||
List<Long> getMemorySizeInBytesList(String path);
|
||||
List<Long> getBytesList(String path);
|
||||
|
||||
List<Long> getMillisecondsList(String path);
|
||||
|
||||
|
@ -327,7 +327,7 @@ class SimpleConfig implements Config {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getMemorySizeInBytesList(String path) {
|
||||
public List<Long> getBytesList(String path) {
|
||||
List<Long> l = new ArrayList<Long>();
|
||||
List<? extends ConfigValue> list = getList(path);
|
||||
for (ConfigValue v : list) {
|
||||
|
@ -721,7 +721,7 @@ class ConfigTest extends TestUtils {
|
||||
assertEquals(1024 * 1024L, conf.getBytes("memsizes.meg"))
|
||||
assertEquals(1024 * 1024L, conf.getBytes("memsizes.megAsNumber"))
|
||||
assertEquals(Seq(1024 * 1024L, 1024 * 1024L, 1024L * 1024L),
|
||||
conf.getMemorySizeInBytesList("memsizes.megsList").asScala)
|
||||
conf.getBytesList("memsizes.megsList").asScala)
|
||||
assertEquals(512 * 1024L, conf.getBytes("memsizes.halfMeg"))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user