CdmNode.getOrDefault

T getOrDefault(T)(string key, T defaultValue) const @safe

Safe read-only lookup with default value.

Like tryGet, but returns a default value instead of null when the key is not found. This is convenient for reading optional configuration values.

Parameters

keyThe member key to look up.
defaultValueValue to return if key is not found.

Returns

The value at key if it exists, otherwise defaultValue.