com.github.mikesafonov.pitest.git.changes.CodeChangelog Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pitest-git-changes-plugin Show documentation
Show all versions of pitest-git-changes-plugin Show documentation
Pitest plugin for mutating git changes
The newest version!
package com.github.mikesafonov.pitest.git.changes;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
public class CodeChangelog implements Iterable {
private final List changes;
public CodeChangelog(List changes) {
this.changes = new ArrayList<>(Objects.requireNonNull(changes));
}
public boolean isEmpty() {
return size() == 0;
}
public boolean isNotEmpty() {
return size() > 0;
}
public int size() {
return changes.size();
}
public boolean contains(String clazz, int line) {
return changes.stream()
.anyMatch(change -> change.getClassName().equals(clazz) && change.containsLine(line));
}
@Override
public Iterator iterator() {
return changes.iterator();
}
}