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

dev.youshallnotpass.inspections.nullfree.nulls.ExcludeComparisons Maven / Gradle / Ivy

The newest version!
package dev.youshallnotpass.inspections.nullfree.nulls;

import dev.youshallnotpass.inspection.InspectionException;
import dev.youshallnotpass.inspection.Violations;
import org.cactoos.iterable.Filtered;
import org.cactoos.list.ListOf;

import java.util.List;

public final class ExcludeComparisons implements Violations {

    private final Violations origin;

    public ExcludeComparisons(final Violations origin) {
        this.origin = origin;
    }

    @Override
    public List asList() throws InspectionException {
        return new ListOf<>(
            new Filtered<>(
                (final Null valuation) -> !valuation.isInComparison(),
                origin.asList()
            )
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy