environment property

Environment get environment

Returns the globally attached Environment.

Throws a IllegalStateException if no environment has been attached via attach.

Implementation

Environment get environment {
  if (_environment == null) {
    throw IllegalStateException(
      "No Environment has been attached. "
      "Call ConfigurationPropertySource.attach(env) first.",
    );
  }
  return _environment!;
}