night-config

Powerful java configuration library for toml, yaml, hocon, json and in-memory configurations. Serialization/deserialization framework.

LGPL-3.0 License

Stars
234
Committers
10

Bot releases are visible (Hide)

night-config - 3.8.1 Async config fixes Latest Release

Published by TheElectronWill 3 months ago

What's Changed

Full Changelog: https://github.com/TheElectronWill/night-config/compare/v3.8.0...v3.8.1

night-config - 3.8.0: API enhancements

Published by TheElectronWill 4 months ago

What's Changed

  • FileWatcher offers new methods that return a CompletableFuture
  • Every FileConfig is now a ConcurrentConfig
  • Some warnings have been fixed.

Full Changelog: https://github.com/TheElectronWill/night-config/compare/v3.7.4...v3.8.0

night-config - 3.7.4: FileWatcher fix

Published by TheElectronWill 4 months ago

This minor release fixes a bug that caused the FileWatcher to close when a directory containing watched files was deleted. Also, an exception is now raised early if the FileWatcher is used in an unsupported manner.

Full Changelog: https://github.com/TheElectronWill/night-config/compare/v3.7.3...v3.7.4

night-config - 3.7.3: FileConfig fix

Published by TheElectronWill 4 months ago

Fixes

This minor release fixes a bad interaction between AsyncFileConfig and StampedConfig, and between SyncFileConfig, SynchronizedConfig and TomlParser, which resulted in some TOML configurations to be mis-loaded. Thanks to @Technici4n for discovering the bug!

Full Changelog: https://github.com/TheElectronWill/night-config/compare/v3.7.2...v3.7.3

night-config - 3.7.2: TOML compliance fix

Published by TheElectronWill 5 months ago

TOML Fixes

The TOML implementation is now more robust thanks to toml-test. We don't call the binary, but rather include the repository as a Git submodule in order to grab all the test files.

Compatibility note: the TOML parser of NightConfig now rejects some files that it would have previously accepted (even though they were invalid). This is intended, and we encourage all users to fix their invalid TOML files.

Please read the release notes of v3.7.0 ✨ to learn what has changed since v3.6.x.

Full Changelog: https://github.com/TheElectronWill/night-config/compare/v3.7.1...v3.7.2

night-config - 3.7.1 Gradle fix

Published by TheElectronWill 5 months ago

Fixes

You should use v3.7.1 instead of v3.7.0.
Please read the release notes of v3.7.0 ✨ to learn what has changed since v3.6.x.

Full Changelog: https://github.com/TheElectronWill/night-config/compare/v3.7.0...v3.7.1

night-config - 3.7.0: NightConfig rejuvenated ✨

Published by TheElectronWill 5 months ago

Major changes

  • FileWatcher now comes with out-of-the-box debouncing, which improves the performance of autoreloading and autosaving configurations ⚡, see https://github.com/TheElectronWill/night-config/pull/148
  • FileConfig instances are now actually thread-safe and work better with autoreload, which should prevent most of the corruption issues 🛡️, see https://github.com/TheElectronWill/night-config/pull/152
  • A new Serialization/Deserialization framework is available in the serde package 🚀, see https://github.com/TheElectronWill/night-config/pull/163.
    Unlike the old ObjectConverter, the new ObjectSerializer and ObjectDeserializer are modular and extensible: you can register your own serializers and deserializers. Deserializers (config -> object) are chosen based on the generic type of the field to set and the type of the config value to deserialize. This allows for fine-grained deserialization. The old ObjectConverter still works but is now deprecated. The goal is to remove the old conversion package in version 4.0.0.

Enhancements

Bug fixes

Compatibility Note

NightConfig 3.7.0 is backward-compatible with previous releases, therefore I encourage you to upgrade your dependency on NightConfig in order to benefit from the new version.

Binary-wise, the backward-compatibility has been checked with japicmp.
Source-wise, there is one small incompatible change: FileWatcher#addWatch no longers throws an IOException, which can result in a compiler error unreachable code on the associated try/catch (example in forge).

New Contributors

Thank you everyone!

Full Changelog: https://github.com/TheElectronWill/night-config/compare/v3.6.7...v3.7.0

night-config - 3.6.7

Published by TheElectronWill about 1 year ago

More bug fixes :)

What's Changed

New Contributors

Full Changelog: https://github.com/TheElectronWill/night-config/compare/v3.6.6...v3.6.7

night-config - 3.6.6 bugfix release

Published by TheElectronWill about 2 years ago

Fixes include: #101, #113

night-config - 3.6.5 bugfix release

Published by TheElectronWill almost 3 years ago

night-config - 3.6.4!

Published by TheElectronWill about 3 years ago

Fix #87, fix #82

night-config - 3.6 bugfix release

Published by TheElectronWill over 4 years ago

See #77

night-config - 3.6 bugfix release

Published by TheElectronWill almost 5 years ago

See #71 😃

night-config - Insertion order preservation support for FileConfigBuilder and ConfigFormat

Published by TheElectronWill over 5 years ago

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. 😃

night-config - Supports preserving the insertion order of config values

Published by TheElectronWill over 5 years ago

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 https://github.com/TheElectronWill/Night-Config/pull/61

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

night-config - Hocon improvements and toml bugfixes

Published by TheElectronWill over 5 years ago

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

Published by TheElectronWill over 5 years ago

Fix writing of enum values for TOML and JSON languages.

night-config - NightConfig v3.5.0 - Enum support

Published by TheElectronWill over 5 years ago

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
night-config - NightConfig v3.4.2 - Boosted ObjectConverter

Published by TheElectronWill almost 6 years ago

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
night-config - NightConfig v3.4.1 - better android support

Published by TheElectronWill about 6 years ago

  • 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
Package Rankings
Top 3.2% on Repo1.maven.org
Badges
Extracted from project README
Maven Central javadoc CircleCI