| 1 | package net.bmahe.genetics4j.core.spec.mutation; | |
| 2 | ||
| 3 | import org.apache.commons.lang3.Validate; | |
| 4 | import org.immutables.value.Value; | |
| 5 | ||
| 6 | @Value.Immutable | |
| 7 | public abstract class PartialMutation implements MutationPolicy { | |
| 8 | ||
| 9 | @Value.Parameter | |
| 10 | public abstract int chromosomeIndex(); | |
| 11 | ||
| 12 | @Value.Parameter | |
| 13 | public abstract MutationPolicy mutationPolicy(); | |
| 14 | ||
| 15 | @Value.Check | |
| 16 | protected void check() { | |
| 17 | Validate.isTrue(chromosomeIndex() >= 0); | |
| 18 | Validate.notNull(mutationPolicy()); | |
| 19 | } | |
| 20 | ||
| 21 | public static PartialMutation of(final int chromosomeIndex, final MutationPolicy mutationPolicy) { | |
| 22 |
2
1. of : replaced return value with null for net/bmahe/genetics4j/core/spec/mutation/PartialMutation::of → NO_COVERAGE 2. of : removed call to net/bmahe/genetics4j/core/spec/mutation/ImmutablePartialMutation::of → NO_COVERAGE |
return ImmutablePartialMutation.of(chromosomeIndex, mutationPolicy); |
| 23 | } | |
| 24 | } | |
Mutations | ||
| 22 |
1.1 2.2 |