fromTemporaryPropertyStruct static method

Danger<PropertyRoster<TemporaryProperty>, PropertyException> fromTemporaryPropertyStruct(
  1. Iterable<TemporaryPropertyStruct> struct
)

Implementation

static Danger<PropertyRoster<TemporaryProperty>, PropertyException> fromTemporaryPropertyStruct(Iterable<TemporaryPropertyStruct> struct) {

    final log = Log(classLocation: PropertyRoster, functionLocation: 'fromTemporaryPropertyStruct');

    final List<TemporaryProperty> list = [];

    for (final i in struct) {

        final result = TemporaryProperty.fromStruct(i);
        log.add(result);
        if (result is! Success<TemporaryProperty, PropertyException>) return Failure(result.asException, log);

        list.add(result.wrapped);

    }

    final result = PropertyRoster.result(list);
    log.add(result);

    return Danger.fromDanger(result, log);

}