JungleConfig is a lightweight, type-safe configuration library for Java that stores key-value pairs — along with their runtime types — in a compact, human-readable file format called JConfig001. Unlike property files or plain JSON configs, every value carries an explicit type tag, so reading a key back always returns the exact Java type you stored, with no manual parsing or casting required. JungleConfig ships with built-in support for primitives, UUIDs, Java Time types, POJOs, and collections, and its layered architecture makes every layer — I/O, caching, encryption, and type conversion — independently swappable.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.
How it works
JungleConfig persists configuration in a custom text format identified by the headerJConfig001. Each subsequent line encodes one entry as:
app.port with value 8080 is stored as:
: (key separator) and the first = (value separator), URL-decodes the value, and routes it through the appropriate type adapter to reconstruct the original Java object. Writing follows the reverse path: the type adapter serialises the object to a string, URL-encodes it, and the file is rewritten atomically.
Layered architecture. Every operation passes through a fixed pipeline of collaborating components:
| Layer | Class | Responsibility |
|---|---|---|
| IOHandler | NativeIOHandler / NativeInMemoryIOHandler | Raw file or in-memory read/write |
| Converter | NativeConverter / NativeEncryptedConverter / NativeFlatJsonConverter | Encode and decode the JConfig001 format |
| Internal Cache | NativeInternalCache | LRU write-back cache that batches disk I/O |
| Transaction | NativeInternalTransaction | Tracks pending writes for commit/rollback |
| Extended Cache | NativeExtendedCache | Second-level cache above the transaction layer |
| TypeConverter | NativeTypeConverter | Dispatches to the correct TypeConverterAdapter for each Java type |
| JungleConfig | JungleConfig | Public API facade that wires the full pipeline |
JungleConfig constructor wires these layers in order, so you always interact with one clean object regardless of which storage backend you chose.
Key features
Type safety
Every value is tagged with its Java type name at write time and automatically reconstructed at read time. No more
(String) properties.get("key") casts.Four configuration modes
Choose from file-backed (
new JungleConfig(file)), AES-encrypted file (EncryptedConfig), purely in-memory (InMemoryConfig), or flat-JSON (FlatJsonConfig) — all sharing the same API.Atomic transactions
Wrap any number of writes in
BeginTransaction() / Commit() or Rollback() to guarantee that partial updates are never persisted.Pluggable type adapters
The
TypeConverterAdapter interface lets you register custom serialisers for any Java type, slotting cleanly into the existing pipeline alongside the ten built-in adapters.POJO and collection support
Store arbitrary Java objects with
SetPOJO and retrieve them with get(key, MyClass.class). Store List, Map, or any generic collection with Set and retrieve with getCollection plus a Jackson TypeReference.Built-in caching
A two-level cache (internal LRU + extended) sits between the API and the disk, reducing redundant I/O without any configuration on your part.
When to use JungleConfig
JungleConfig is a good fit when you need a self-contained configuration store for a Java application — a CLI tool, a desktop app, a daemon, or a microservice — and you want the configuration to be readable and editable by humans without losing the type information that your code relies on. It is especially useful when you need to persist structured objects (POJOs or collections) without standing up a database, or when sensitive configuration values must be stored encrypted on disk without pulling in a heavyweight secrets manager.JungleConfig requires Java 19 or later. Its only external runtime dependency is the Jackson suite:
jackson-databind, jackson-datatype-jdk8, and jackson-datatype-jsr310. No other third-party libraries are required.