RhinoInference constructor

RhinoInference(
  1. bool _isFinalized,
  2. bool? _isUnderstood,
  3. String? _intent,
  4. Map<String, String>? _slots,
)

private constructor + basic checks

Implementation

RhinoInference(
    this._isFinalized, this._isUnderstood, this._intent, this._slots) {
  if (isFinalized) {
    if (_isUnderstood == null) {
      throw RhinoInvalidStateException(
          "field 'isUnderstood' must be present if inference was finalized.");
    }

    if (_isUnderstood!) {
      if (_intent == null || _slots == null) {
        throw RhinoInvalidStateException(
            "fields 'intent' and 'slots' must be present if inference was understood");
      }
    }
  }
}