incrementLaps method
Implementation
Danger<PropertyTable, PropertyTableException> incrementLaps(PropertyName temporaryPropertyName) {
final log = Log(classLocation: runtimeType, functionLocation: 'incrementLaps');
// 1.
final getResult = temporaryPropertyRoster.getByPrimaryKey(temporaryPropertyName);
log.add(getResult);
if (getResult is! Success<TemporaryProperty, RosterPatternExceptionB>) return Failure(PropertyTableExceptionD(), log.monitor({
'the temporary property name does not exist': temporaryPropertyName.value,
'temporary property name list exist': temporaryPropertyRoster.nameList.toPrimitive(),
}));
final property = getResult.wrapped.increment();
final updateResult = temporaryPropertyRoster.update(property);
log.add(updateResult);
// 1. より 必ず存在するので PropertyTableExceptionB を throw out.
if (updateResult is! Success<PropertyRoster<TemporaryProperty>, PropertyExceptionB>) Result.panic(PropertyTableErrorA(), log);
// 指定した temporary property laps が increment されるだけなので validation は不要.
final result = PropertyTable._(this.permanentlyPropertyRoster, updateResult.wrapped, this.listPropertyRoster, this.fragmentPropertyRoster);
return Success(result, log);
}