fromChainAndTemplateFileSetting static method

Danger<List<TextArraySymbol>, ChainException> fromChainAndTemplateFileSetting(
  1. Chain chain,
  2. TemplateFileSetting tempalteFileSetting
)

Implementation

static Danger<List<TextArraySymbol>, ChainException> fromChainAndTemplateFileSetting(Chain chain, TemplateFileSetting tempalteFileSetting) {

    final log = Log(classLocation: TextArraySymbol, functionLocation: 'fromChainAndTemplateFileSetting');

    final List<TextArraySymbol> list = [];

    for (final i in tempalteFileSetting.textArraySymbolNames) {

        final getResult = chain.getOptionAsMultipleString(i);
        log.add(getResult);
        if (getResult is! Success<List<String>, ChainExceptionI>) return Failure(getResult.asException, log);

        final symbol = TextArraySymbol.fromPrimitive(i, getResult.wrapped);

        list.add(symbol);

    }

    return Success(list, log);

}