2 * Copyright (C) 2015 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jcore.criteria;
19 import java.util.HashMap;
22 import org.mxchange.jcore.BaseFrameworkSystem;
23 import org.mxchange.jcore.criteria.logical.Logical;
26 * A general criteria class
28 * @author Roland Haeder
30 public class BaseCriteria extends BaseFrameworkSystem implements Criteria {
34 private final Map<String, Object> criteria;
37 * Logical matcher instance
39 private Logical logcial;
42 * Protected default construtctor
44 protected BaseCriteria () {
45 // Init criteria instance
46 this.criteria = new HashMap<>();
50 public void addCriteria (final String key, final Boolean value) {
52 this.criteria.put(key, value);
56 public void addCriteria (final String key, final String value) {
58 this.criteria.put(key, value);
62 public void addCriteria (final String key, final Number value) {
63 this.criteria.put(key, value);
67 public Set<Map.Entry<String, Object>> entrySet () {
68 return this.criteria.entrySet();
72 * Setter for Logical instance
74 * @param logcial the Logical instance to set
76 public final void setLogcial (final Logical logcial) {
77 this.logcial = logcial;
81 public Iterable<Object> values () {
83 return this.criteria.values();
88 * Getter for Logical matcher instance
90 * @return Logical matcher instance
92 protected final Logical getLogical () {