| 1 | package org.sanmibuh.ddd.port; | |
| 2 | ||
| 3 | import java.util.Optional; | |
| 4 | import org.sanmibuh.ddd.domain.AggregateNotFoundException; | |
| 5 | import org.sanmibuh.ddd.domain.AggregateRoot; | |
| 6 | import org.sanmibuh.ddd.domain.AggregateRootId; | |
| 7 | ||
| 8 | public interface Repository<A extends AggregateRoot<I>, I extends AggregateRootId<?>> { | |
| 9 | ||
| 10 | Optional<A> findById(I id); | |
| 11 | ||
| 12 | void save(A aggregate); | |
| 13 | ||
| 14 | default A get(final I id) { | |
| 15 |
2
1. lambda$get$0 : replaced return value with null for org/sanmibuh/ddd/port/Repository::lambda$get$0 → KILLED 2. get : replaced return value with null for org/sanmibuh/ddd/port/Repository::get → KILLED |
return findById(id).orElseThrow(() -> new AggregateNotFoundException(id)); |
| 16 | } | |
| 17 | } | |
Mutations | ||
| 15 |
1.1 2.2 |