OrPredicate.java revision 2224:2a8815d86b93
1294838Szbb/*
2294838Szbb * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
3294838Szbb * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4294838Szbb *
5294838Szbb * This code is free software; you can redistribute it and/or modify it
6294838Szbb * under the terms of the GNU General Public License version 2 only, as
7294838Szbb * published by the Free Software Foundation.
8294838Szbb *
9294838Szbb * This code is distributed in the hope that it will be useful, but WITHOUT
10294838Szbb * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11294838Szbb * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12294838Szbb * version 2 for more details (a copy is included in the LICENSE file that
13294838Szbb * accompanied this code).
14294838Szbb *
15294838Szbb * You should have received a copy of the GNU General Public License version
16294838Szbb * 2 along with this work; if not, write to the Free Software Foundation,
17294838Szbb * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18294838Szbb *
19294838Szbb * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20294838Szbb * or visit www.oracle.com if you need additional information or have any
21294838Szbb * questions.
22294838Szbb *
23294838Szbb */
24294838Szbb
25294838Szbbpackage jdk.test.lib.cli.predicate;
26294838Szbb
27294838Szbbimport java.util.function.BooleanSupplier;
28294838Szbb
29294838Szbbpublic class OrPredicate implements BooleanSupplier {
30294838Szbb    private final BooleanSupplier a;
31294838Szbb    private final BooleanSupplier b;
32294838Szbb
33294838Szbb    public OrPredicate(BooleanSupplier a, BooleanSupplier b) {
34294838Szbb        this.a = a;
35294838Szbb        this.b = b;
36294838Szbb    }
37294838Szbb
38294838Szbb    @Override
39294838Szbb    public boolean getAsBoolean() {
40294838Szbb        return a.getAsBoolean() || b.getAsBoolean();
41294838Szbb    }
42294838Szbb}
43294838Szbb