deephaven.configuration

This module provides access to the Deephaven Configuration system, allowing users to retrieve configuration properties as strings, integers, floats, or booleans with optional default values.

class Configuration(j_configuration=None)[source]

Bases: JObjectWrapper

A wrapper for the Java Configuration class that provides convenient access to configuration properties.

This class wraps the singleton Configuration.getInstance() by default, but can also wrap a passed in Configuration instance.

Initialize a Configuration wrapper.

Parameters:

j_configuration (Optional[jpy.JType]) – The Java Configuration instance to wrap. If None, uses the default Configuration.getInstance().

get_bool(property_name, default=None)[source]

Get a configuration property as a boolean.

Parameters:
  • property_name (str) – The name of the property to retrieve.

  • default (Optional[bool]) – The default value to return if the property is not set. If None and the property is not set, raises DHError.

Returns:

The property value as a boolean, or the default value if provided and the property is not set.

Return type:

Optional[bool]

Raises:

DHError – If the property is not set and no default value is provided, or if the property value cannot be parsed as a boolean.

get_float(property_name, default=None)[source]

Get a configuration property as a float (double).

Parameters:
  • property_name (str) – The name of the property to retrieve.

  • default (Optional[float]) – The default value to return if the property is not set. If None and the property is not set, raises DHError.

Returns:

The property value as a float, or the default value if provided and the property is not set.

Return type:

Optional[float]

Raises:

DHError – If the property is not set and no default value is provided, or if the property value cannot be parsed as a float.

get_int(property_name, default=None)[source]

Get a configuration property as an integer.

Parameters:
  • property_name (str) – The name of the property to retrieve.

  • default (Optional[int]) – The default value to return if the property is not set. If None and the property is not set, raises DHError.

Returns:

The property value as an integer, or the default value if provided and the property is not set.

Return type:

Optional[int]

Raises:

DHError – If the property is not set and no default value is provided, or if the property value cannot be parsed as an integer.

get_long(property_name, default=None)[source]

Get a configuration property as a long integer.

Parameters:
  • property_name (str) – The name of the property to retrieve.

  • default (Optional[int]) – The default value to return if the property is not set. If None and the property is not set, raises DHError.

Returns:

The property value as a long integer, or the default value if provided and the property is not set.

Return type:

Optional[int]

Raises:

DHError – If the property is not set and no default value is provided, or if the property value cannot be parsed as a long.

get_property(property_name, default=None)[source]

Get a configuration property as a string.

Parameters:
  • property_name (str) – The name of the property to retrieve.

  • default (Optional[str]) – The default value to return if the property is not set. If None and the property is not set, raises DHError.

Returns:

The property value as a string, or the default value if provided and the property is not set.

Return type:

Optional[str]

Raises:

DHError – If the property is not set and no default value is provided.

get_string(property_name, default=None)[source]

Get a configuration property as a string. Alias for get_property.

Parameters:
  • property_name (str) – The name of the property to retrieve.

  • default (Optional[str]) – The default value to return if the property is not set. If None and the property is not set, raises DHError.

Returns:

The property value as a string, or the default value if provided and the property is not set.

Return type:

Optional[str]

Raises:

DHError – If the property is not set and no default value is provided.

has_property(property_name)[source]

Check if a configuration property is defined.

Parameters:

property_name (str) – The name of the property to check.

Returns:

True if the property is defined, False otherwise.

Return type:

bool

items()[source]

Return a dynamic view of the mapping’s (key, value) pairs.

property j_object

The wrapped Java Configuration instance.

j_object_type

alias of Configuration

keys()[source]

Return a dynamic view of the mapping’s keys.

values()[source]

Return a dynamic view of the mapping’s values.

get_configuration()[source]

Get the default Configuration instance.

Returns:

The default Configuration instance wrapping Configuration.getInstance().

Return type:

Configuration