All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mikesafonov.pitest.git.changes.CodeChangelog Maven / Gradle / Ivy

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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy