package com.capgemini.framework.teamcenter.resolution.filtering;

import lombok.AllArgsConstructor;

/** {@link ITcTypeFilter} class that combines two sub-{@link ITcTypeFilter} into a logical OR. */
@AllArgsConstructor
public class OrFilter implements ITcTypeFilter {

    private final ITcTypeFilter filter1;
    private final ITcTypeFilter filter2;

    @Override
    public boolean isExcluded(final String type) {
        return filter1.isExcluded(type) && filter2.isExcluded(type);
    }

    @Override
    public boolean isIncluded(final String type) {
        return filter1.isIncluded(type) || filter2.isIncluded(type);
    }
}
