@@ -0,0 +1,1740 @@
+/*%0A * Copyright 2018, TeamDev. All rights reserved.%0A *%0A * Redistribution and use in source and/or binary forms, with or without%0A * modification, must retain the above copyright notice and the following%0A * disclaimer.%0A *%0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS%0A * %22AS IS%22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT%0A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR%0A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT%0A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,%0A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT%0A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,%0A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY%0A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT%0A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE%0A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A */%0A%0Apackage io.spine.server.entity;%0A%0Aimport com.google.common.collect.ImmutableList;%0Aimport io.spine.core.Event;%0A%0Aimport java.util.Optional;%0A%0A/**%0A * @author Dmytro Dashenkov%0A */%0Apublic class CompositeEventFilter implements EventFilter %7B%0A%0A    private final ImmutableList%3CEventFilter%3E filters;%0A%0A    private CompositeEventFilter(ImmutableList%3CEventFilter%3E filters) %7B%0A        this.filters = filters;%0A    %7D%0A%0A    @Override%0A    public Optional%3CEvent%3E filter(Event event) %7B%0A        Optional%3CEvent%3E result = Optional.of(event);%0A        for (EventFilter filter : filters) %7B%0A            result = filter.filter(result.get());%0A            if (!result.isPresent()) %7B%0A                break;%0A            %7D%0A        %7D%0A        return result;%0A    %7D%0A%7D%0A

Implement composite EventFilters.