Skip to content

Package: DatastorePredicateFactory

DatastorePredicateFactory

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2020, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.datastore.model.query.predicate;
14:
15: import org.eclipse.kapua.service.storable.model.query.predicate.StorablePredicateFactory;
16:
17: /**
18: * @since 1.3.0
19: */
20: public interface DatastorePredicateFactory extends StorablePredicateFactory {
21:
22: /**
23: * Instantiates a {@link ChannelMatchPredicate}.
24: *
25: * @param expression The expression.
26: * @return The newly instantiated {@link ChannelMatchPredicate}.
27: * @since 1.0.0
28: */
29: ChannelMatchPredicate newChannelMatchPredicate(String expression);
30:
31: /**
32: * Instantiates a {@link MetricPredicate}
33: *
34: * @param metricName The metric name to filter.
35: * @param type The type of the metric to filter
36: * @param minValue The lower limit. Can be {@code null}.
37: * @param maxValue The upper limit. Can be {@code null}.
38: * @return The newly instantiated {@link MetricPredicate}.
39: * @since 1.0.0
40: */
41: <V extends Comparable<V>> MetricPredicate newMetricPredicate(String metricName, Class<V> type, V minValue, V maxValue);
42:
43: /**
44: * Instantiates a {@link MetricExistsPredicate}.
45: *
46: * @param metricName The metric name to look for.
47: * @param type The {@link Class} type of the Metric.
48: * @param <V> The {@link Comparable} type.
49: * @return The newly instantiated {@link MetricExistsPredicate}
50: * @since 1.0.0
51: */
52: <V extends Comparable<V>> MetricExistsPredicate newMetricExistsPredicate(String metricName, Class<V> type);
53: }