fromYamlMapAndKey static method
Implementation
static Danger<ObjectValuable, BpriverYamlException> fromYamlMapAndKey(YamlMap yamlMap, String key) {
final log = Log(classLocation: ObjectValuable, functionLocation: 'fromYamlMapAndKey');
final actionResult = BpriverYaml.getByKeyFromYamlMapThenAction<Danger<ObjectValuable, BpriverYamlException>>(yamlMap, key,
thenString: (value) => Success(CitrusText(value)),
thenBoolean: (value) => Success(CitrusFlag(value)),
thenList: (value) {
final parseResult = BpriverYaml.parseYamlListAsT<String>(value);
log.add(parseResult);
if (parseResult is! Success<List<String>, BpriverYamlExceptionF>) return Failure(parseResult.asException, log);
return Success(CitrusTextArray.from(parseResult.wrapped));
});
log.add(actionResult);
if (actionResult is! Success<Danger<ObjectValuable, BpriverYamlException>, BpriverYamlExceptionDH>) return Failure(actionResult.asException, log);
final result = actionResult.wrapped;
log.add(result);
if (result is! Success<ObjectValuable, BpriverYamlException>) return Failure(result.asException, log);
return Success(result.wrapped, log);
}