diff --git a/core/src/main/java/com/electronwill/nightconfig/core/ConcurrentConfigSpec.java b/core/src/main/java/com/electronwill/nightconfig/core/ConcurrentConfigSpec.java index aacac36c..af73f257 100644 --- a/core/src/main/java/com/electronwill/nightconfig/core/ConcurrentConfigSpec.java +++ b/core/src/main/java/com/electronwill/nightconfig/core/ConcurrentConfigSpec.java @@ -5,6 +5,6 @@ */ public class ConcurrentConfigSpec extends ConfigSpec { public ConcurrentConfigSpec() { - super(InMemoryFormat.withUniversalSupport().createConcurrentConfig()); + super(Config.inMemoryUniversalConcurrent()); } } \ No newline at end of file diff --git a/core/src/main/java/com/electronwill/nightconfig/core/ConfigSpec.java b/core/src/main/java/com/electronwill/nightconfig/core/ConfigSpec.java index e409c59e..dba4da97 100644 --- a/core/src/main/java/com/electronwill/nightconfig/core/ConfigSpec.java +++ b/core/src/main/java/com/electronwill/nightconfig/core/ConfigSpec.java @@ -61,7 +61,7 @@ public class ConfigSpec { protected final Config storage; public ConfigSpec() { - this(InMemoryFormat.withUniversalSupport().createConfig()); + this(Config.inMemoryUniversal()); } ConfigSpec(Config storage) { diff --git a/core/src/main/java/com/electronwill/nightconfig/core/SimpleConfig.java b/core/src/main/java/com/electronwill/nightconfig/core/SimpleConfig.java index e32c7ff0..20f4f9ab 100644 --- a/core/src/main/java/com/electronwill/nightconfig/core/SimpleConfig.java +++ b/core/src/main/java/com/electronwill/nightconfig/core/SimpleConfig.java @@ -50,8 +50,7 @@ final class SimpleConfig extends AbstractConfig { * @param configFormat the config's format * @param concurrent */ - SimpleConfig(UnmodifiableConfig toCopy, ConfigFormat configFormat, - boolean concurrent) { + SimpleConfig(UnmodifiableConfig toCopy, ConfigFormat configFormat, boolean concurrent) { super(toCopy, concurrent); this.configFormat = configFormat; } diff --git a/core/src/test/java/com/electronwill/nightconfig/core/AbstractConfigTest.java b/core/src/test/java/com/electronwill/nightconfig/core/AbstractConfigTest.java index c5aba2d3..74ee5f23 100644 --- a/core/src/test/java/com/electronwill/nightconfig/core/AbstractConfigTest.java +++ b/core/src/test/java/com/electronwill/nightconfig/core/AbstractConfigTest.java @@ -49,7 +49,7 @@ public void basicTest() { config.set("stringList", stringList); assertSame(stringList, config.get("stringList")); - Config subConfig = InMemoryFormat.withUniversalSupport().createConfig(); + Config subConfig = Config.inMemoryUniversal(); subConfig.set("string", "test!"); subConfig.set("subSubConfig.string", "another test!"); config.set("subConfig", subConfig); @@ -84,7 +84,7 @@ public void specialCase() { String[] jsplit = ".a...a.".split("\\."); System.out.println("String#split: " + Arrays.toString(jsplit)); - Config config = InMemoryFormat.withUniversalSupport().createConfig(); + Config config = Config.inMemoryUniversal(); config.set(".a...a.", "value"); assertTrue(config.contains(".a...a.")); assertEquals("value", config.get(".a...a.")); @@ -102,11 +102,11 @@ public void specialCase() { @Test public void size() { - Config config = InMemoryFormat.withUniversalSupport().createConfig(); + Config config = Config.inMemoryUniversal(); config.set("a.b.c", "value"); config.set("pi", PI); - Config subConfig = InMemoryFormat.withUniversalSupport().createConfig(); + Config subConfig = Config.inMemoryUniversal(); subConfig.set("string", "test!"); config.set("subConfig", subConfig); @@ -116,7 +116,7 @@ public void size() { @Test public void asMap() { - Config config = InMemoryFormat.withUniversalSupport().createConfig(); + Config config = Config.inMemoryUniversal(); config.set("a.b.c", "value"); config.set("pi", PI); @@ -136,7 +136,7 @@ public void asMap() { @Test public void containsValue() { - Config config = InMemoryFormat.withUniversalSupport().createConfig(); + Config config = Config.inMemoryUniversal(); config.set("a.b.c", "value"); assertTrue(config.contains("a")); assertFalse(config.contains("b")); diff --git a/core/src/test/java/com/electronwill/nightconfig/core/conversion/ObjectConverterTest.java b/core/src/test/java/com/electronwill/nightconfig/core/conversion/ObjectConverterTest.java index ce6cfe63..625087bb 100644 --- a/core/src/test/java/com/electronwill/nightconfig/core/conversion/ObjectConverterTest.java +++ b/core/src/test/java/com/electronwill/nightconfig/core/conversion/ObjectConverterTest.java @@ -35,7 +35,7 @@ public class ObjectConverterTest { nestedList3 = Arrays.asList(nestedList2, nestedList2); } - static final Config config1 = InMemoryFormat.withUniversalSupport().createConfig(); + static final Config config1 = Config.inMemoryUniversal(); static final Config config2 = Config.inMemory(); private final Config config = Config.inMemory(); diff --git a/core/src/test/java/com/electronwill/nightconfig/core/conversion/ObjectConverterTest2.java b/core/src/test/java/com/electronwill/nightconfig/core/conversion/ObjectConverterTest2.java index f6616aaa..0861e7bc 100644 --- a/core/src/test/java/com/electronwill/nightconfig/core/conversion/ObjectConverterTest2.java +++ b/core/src/test/java/com/electronwill/nightconfig/core/conversion/ObjectConverterTest2.java @@ -45,7 +45,7 @@ public void testSupportBasic() { @Test public void testSupportAll() { ObjectConverter converter = new ObjectConverter(); - Config config = InMemoryFormat.withUniversalSupport().createConfig(); + Config config = Config.inMemoryUniversal(); // withUniversalSupport() causes the configuration to accept any type of values without conversion MyObject object = new MyObject(); @@ -92,7 +92,7 @@ private static class MyObject { String string = "value"; List stringList = Arrays.asList("a", "b", "c"); List objList = objects; - Config config = InMemoryFormat.withUniversalSupport().createConfig(); + Config config = Config.inMemoryUniversal(); MyObject subObject; @Conversion(CoordinatesConverter.class)