Skip to content

Releases: TheElectronWill/night-config

3.6.4!

07 Aug 20:04
Compare
Choose a tag to compare

Fix #87, fix #82

3.6 bugfix release

03 May 10:59
4ac1b3c
Compare
Choose a tag to compare

3.6 bugfix release

01 Nov 10:20
Compare
Choose a tag to compare

Insertion order preservation support for FileConfigBuilder and ConfigFormat

17 Apr 23:16
Compare
Choose a tag to compare

This release resolves the issue #62 by adding two methods to FileConfigBuilder:

  • preserveInsertionOrder()
  • backingMapCreator(Supplier<Map<String, Object>>)

And some other things around the backing map of configurations.

Breaking change if you implement your own ConfigFormat (for advanced users)

If you implement your own ConfigFormat, please note that the interface now requires you to implement the new method createConfig(Supplier<Map<String, Object>>).

The two methods createConfig() and createConcurrentConfig() are now default methods and don't need to be implemented. They both call createConfig(Supplier) with the result of Config.getDefaultMapCreator(boolean).

You can read the detailed changes here.

I don't implement my own ConfigFormat, what happens to me? (for normal users)

If you don't implement your own ConfigFormat then everything is fine! Just enjoy the new features. 😃

Supports preserving the insertion order of config values

14 Apr 23:12
Compare
Choose a tag to compare

You can now use the following code to make all new configurations preserve the insertion order of their values.

Config.setInsertionOrderPreserved(true)

You can also provide your own map supplier ("map creator") on a case-by-case basis. See PR #61

Unlike wrapping a LinkedHashMap, these two new possibilities also work with nested configs.

Hocon improvements and toml bugfixes

30 Mar 18:12
Compare
Choose a tag to compare
v3.5.2

TomlParser: Remove superfluous call to trimmedView()

NightConfig v3.5.1 - I would like to write enums please!

23 Mar 18:01
Compare
Choose a tag to compare

Fix writing of enum values for TOML and JSON languages.

NightConfig v3.5.0 - Enum support

14 Mar 20:52
Compare
Choose a tag to compare

Enum support

Enum values are now supported via the getEnum methods which can convert strings and integers to enum values of the specified class.

config.set("key", MyEnum.A);
config.set("string", "A");
config.set("ordinal", 0);
MyEnum value = config.getEnum("key", MyEnum.class); // We could have used config.get("key") here
MyEnum valueByString = config.getEnum("string", MyEnum.class); // getEnum is necessary to convert the string to an Enum value
MyEnum valueByOrdinal = config.getEnum("ordinal", MyEnum.class, EnumGetMethod.ORDINAL_OR_NAME);

There exists variants of getOrElse and getOptional for enums :

MyEnum value = config.getEnumOrElse("key", MyEnum.B);
Optional<MyEnum> optionalValue = config.get("key", MyEnum.class);

Bugfixes

The following bugs have been fixed:

  • ConfigSpec: issue #49 resolved
  • TOML: issues #51 and #53 resolved

NightConfig v3.4.2 - Boosted ObjectConverter

18 Nov 13:02
Compare
Choose a tag to compare

Boosted ObjectConverter

ObjectConverter now

  • converts the superclass fields too (see #48)
  • supports all types of Collection, not just lists
  • handles generic nested collections, like LinkedList<Collection<List<Optional<SomeObject>>>> (see #47)

These improvements are also available to the android modules.

Other improvements include

  • Tests rewritten with JUnit instead of ifs and Java asserts
  • A few mistakes have been fixed

NightConfig v3.4.1 - better android support

27 Sep 16:35
Compare
Choose a tag to compare
  • Special android modules which don't use java.nio.file nor java.util.function in order to be compatible with old versions of Android (i.e. below api level 26).
  • Fix charset parameter in ConfigParser: the parameter was ignored, it now works properly