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

com.github.alkedr.matchers.reporting.PresentMatcher Maven / Gradle / Ivy

package com.github.alkedr.matchers.reporting;

import com.github.alkedr.matchers.reporting.reporters.SafeTreeReporter;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;

class PresentMatcher extends BaseMatcher implements ReportingMatcher {
    static final PresentMatcher INSTANCE = new PresentMatcher<>();

    private PresentMatcher() {
    }

    @Override
    public void run(Object item, SafeTreeReporter safeTreeReporter) {
        safeTreeReporter.correctlyPresent();
    }

    @Override
    public void runForAbsentItem(SafeTreeReporter safeTreeReporter) {
        safeTreeReporter.incorrectlyAbsent();
    }

    @Override
    public boolean matches(Object item) {
        return true;
    }

    @Override
    public void describeTo(Description description) {
        description.appendText("present");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy