Class AukioConfig
Default file: ~/.config/aukio/config.yaml (override with
-Daukio.config=<path>; the legacy -De3d.config=<path>
is honored as a fallback for engine-only tooling). A missing file
means empty configuration — every getter falls back to its caller
supplied default.
Tenancy is by YAML section, flat camelCase keys per section:
e3d (engine), fo4 (Fallout 4 environment), app
(workspace app; its state subtree is written by the app at
runtime). Unknown keys in the file are preserved verbatim.
Freshness: every getter checks the file's (mtime, size, fileKey)
stamp and re-parses only when it changed, so hand edits made while an
app is running become visible on the next read. Writes
(setString and friends) lock a sidecar <file>.lock,
re-read the file under the lock, merge the new key, and atomically
rename a temp file into place — a hand edit made between the writer's
read and write survives. All cooperating processes must use this
class; an editor saving a stale buffer over newer YAML is the one
race no file format can solve (Emacs's changed-on-disk warning is
the guard).
Known limitation: SnakeYAML rewrites the file on the first
set, so human-written header comments are not preserved
through app writes — conventions live in each repo's AGENTS.org, not
in the file.
Instances are cached per resolved path in a per-JVM registry:
get() returns the same instance to every caller in this
JVM (engine, workspace app, environments), so the stamp cache is
shared. Separate JVMs each hold their own instance.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AukioConfigCached instance for the given file (same path → same instance).static AukioConfigCached instance for the given file (same path → same instance).static AukioConfigget()Instance for the default file, honoring system property overrides.booleangetBoolean(String dottedPath, boolean fallback) Boolean value at the dotted path, orfallbackwhen absent.doubleNumeric value at the dotted path, orfallbackwhen absent/unparseable.intNumeric value at the dotted path truncated to int.String value at the dotted path, orfallbackwhen absent.getStringMap(String dottedPath) All scalar leaves under a section, flattened to dotted keys (e.g.path()The file this instance reads and writes.voidsetBoolean(String dottedPath, boolean value) Sets a boolean value.voidSets a double value.voidSets an int value.voidSets a string value, creating intermediate sections as needed.
-
Method Details
-
get
Instance for the default file, honoring system property overrides. -
forFile
Cached instance for the given file (same path → same instance). -
forFile
Cached instance for the given file (same path → same instance). -
path
The file this instance reads and writes. -
getString
-
getDouble
Numeric value at the dotted path, orfallbackwhen absent/unparseable. -
getInt
Numeric value at the dotted path truncated to int. -
getBoolean
Boolean value at the dotted path, orfallbackwhen absent. -
getStringMap
-
setString
-
setInt
Sets an int value. -
setDouble
Sets a double value. -
setBoolean
Sets a boolean value.
-