JungleConfig is built on a strictly layered architecture where each layer communicates only with the interface immediately below it. This design allows any layer to be swapped out independently — for example, replacing the IO layer with an encrypted implementation without touching the caching or type-conversion logic. The layers are assembled from outermost (public API) to innermost (raw I/O):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.
TypeConverter
Package:com.codehack.JungleConfig.Core
TypeConverter is the top-level interface that JungleConfig delegates every operation to. The default implementation is NativeTypeConverter, which holds a registry of TypeConverterAdapter instances and a reference to a CacheInterface. Every method on JungleConfig’s public API maps 1-to-1 to a method on this interface.
Interface declaration
Interface declaration
TypeConverterAdapter instead.
CacheInterface
Package:com.codehack.JungleConfig.Core
CacheInterface sits directly below TypeConverter and above InternalServiceInterface. It adds the transaction lifecycle methods (BeginTransaction, EndTransaction, Commit, rollback) and exposes all entry-level read/write operations in terms of TypeMap.Entry triples rather than raw typed objects. The default implementation is NativeExtendedCache.
Interface declaration
Interface declaration
NativeTypeConverter. Each entry is a TypeMap.Entry<String, String, String> where the key is the configuration key, getValue1() is the type tag, and getValue2() is the encoded value string.
InternalServiceInterface
Package:com.codehack.JungleConfig.Core
InternalServiceInterface wraps InternalCacheInterface and adds transaction support (begin, end, commit, rollback) as well as the full suite of single-entry read/write/remove/query operations. The default implementation is NativeInternalTransaction, which buffers writes in a transaction log and applies them atomically on commit.
InternalCacheInterface
Package:com.codehack.JungleConfig.Core
InternalCacheInterface is an implementation-detail interface that sits between ConverterInterface and InternalServiceInterface. It defines how pending writes and removals are batched before being flushed to the converter layer. The default implementation is NativeInternalCache, which accepts write and read margin thresholds that control how frequently the cache is flushed to disk.
InternalCacheInterface to swap out the write-batching and read-margin strategy without touching any other layer.
ConverterInterface
Package:com.codehack.JungleConfig.Core
ConverterInterface is responsible for low-level encoding and decoding between the flat string stored by IOHandlerInterface and the structured TypeMap used by the caching layers. It handles URL-decoding, splitting the file content into key-value-type triples, and any additional transformations such as encryption. Implementations include NativeConverter (standard format), NativeEncryptedConverter (AES-encrypted), and NativeFlatJsonConverter (JSON format).
Interface declaration
Interface declaration
| Method | Description |
|---|---|
decode() | Reads the raw string from IOHandlerInterface, URL-decodes values, and parses it into a TypeMap. |
encode(TypeMap) | Serializes the TypeMap back to a string (URL-encoding values) and writes it via IOHandlerInterface. |
Backup(File, boolean) | Delegates to IOHandlerInterface.Backup after ensuring the current state is flushed. |
IOHandlerInterface
Package:com.codehack.JungleConfig.Core
IOHandlerInterface is the lowest layer of the stack. It abstracts raw string-level I/O, allowing the rest of the system to remain agnostic about whether data lives on disk or in memory.
Interface declaration
Interface declaration
| Method | Description |
|---|---|
Read() | Returns the entire contents of the backing store as a single string. |
Write(String data) | Replaces the entire contents of the backing store with data. |
Backup(File path, boolean override) | Copies the current store to path. Returns true on success. If override is false and path already exists, returns false without overwriting. |
NativeIOHandler— reads from and writes to ajava.io.Fileon disk.NativeInMemoryIOHandler— holds the data string in aStringfield; no file I/O occurs. Used byInMemoryConfig()andFlatJsonConfig().
TypeMap
Package:com.codehack.JungleConfig.DataModel
TypeMap<T, D, S> is a generic ordered triple-entry map. Unlike java.util.Map, each entry holds three values: a key of type T, a first value of type D, and a second value of type S. Insertion order is preserved. Throughout JungleConfig, the concrete parameterization is always TypeMap<String, String, String>, where the three strings represent the configuration key, the type tag, and the encoded value respectively.
TypeMap class declaration (key members)
TypeMap class declaration (key members)
Key Methods
| Method | Description |
|---|---|
put(key, v1, v2) | Inserts a new entry or replaces the existing entry with the same key. |
get(key) | Returns the Entry for key, or null if not present. |
remove(String key) | Removes the entry with the given key. Returns true if it existed. |
containsKey(key) | Returns true if an entry with the given key exists. |
getEntryList() | Returns the full ordered list of all entries. |
getKeyList() | Returns an ordered list of all keys. |
clear() | Removes all entries. |
indexOf(key) | Returns the index of the entry with the given key in the internal list. |
TypeMap equality is key-only: two Entry objects are considered equal if their keys are equal, regardless of getValue1() or getValue2(). This means put(key, v1, v2) on an existing key updates the entry in place rather than adding a duplicate.Usage: Iterating Query Results
TypeMap is the return type of JungleConfig.query(). Use getEntryList() to iterate the results:
