This guide walks you through the minimum steps needed to add JungleConfig to an existing Maven project, write a handful of typed configuration values to a file, and read them back — all without any XML configuration or framework setup. By the end you will have a working config file on disk and a clear picture of the core API.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/himansaBro/JungleConfig/llms.txt
Use this file to discover all available pages before exploring further.
Add the Maven dependency
Add JungleConfig and its three Jackson dependencies to your After saving, run
pom.xml. Jackson handles POJO serialisation and Java Time support; all three modules are required.mvn dependency:resolve to confirm Maven can download the artifacts.Create a JungleConfig instance
Point a
JungleConfig object at a file on disk. If the file does not exist, JungleConfig creates it automatically.Store primitive values
Use The resulting
Set(key, value) to persist any of the built-in types. The method is fluent, so you can chain multiple calls. Each stored value is automatically tagged with its Java type name in the config file.app.conf file will contain lines like:Read values back
JungleConfig offers two read styles. Use the lowercase
get(key, Class) when you are certain the key exists — it returns the value directly or null. Use the uppercase Get(key, Class) when the key may be absent — it returns an Optional<T>, forcing you to handle the missing case explicitly.Store and read a POJO
For structured data, use
SetPOJO(key, object) to serialise any Java bean to the config file, then read it back with get(key, YourClass.class). The POJO must have a no-argument constructor and public fields or standard getters/setters (standard Jackson rules apply).Store and read a collection
Generic collections need a Jackson
TypeReference so the element type is preserved at runtime. Use Set(key, list) to write and getCollection(key, typeRef) (or GetCollection for the Optional variant) to read.Always use
getCollection / GetCollection with a TypeReference for any generic type (List<T>, Map<K,V>, etc.). Using get with List.class discards the element type and will return a list of raw LinkedHashMap objects instead.Next steps
Configuration modes
Compare File, EncryptedFile, InMemory, and FlatJson modes and learn when to choose each one.
Transactions
Use
BeginTransaction, Commit, and Rollback to make config updates atomic.Encryption
Protect sensitive values at rest with the built-in AES-encrypted file mode.
API reference
Full reference for every method on the
JungleConfig class.