Skip to content

Package: AttributePredicateImpl

AttributePredicateImpl

nameinstructionbranchcomplexitylinemethod
AttributePredicateImpl(String, Object)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
AttributePredicateImpl(String, Object, AttributePredicate.Operator)
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getAttributeName()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getAttributeValue()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getOperator()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2016, 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.commons.model.query.predicate;
14:
15: import org.eclipse.kapua.model.query.predicate.AttributePredicate;
16:
17: /**
18: * {@link AttributePredicate} implementation.
19: *
20: * @since 1.0.0
21: */
22: public class AttributePredicateImpl<T> implements AttributePredicate<T> {
23:
24: private String attributeName;
25: private T attributeValue;
26: private Operator operator;
27:
28: /**
29: * Constructor.
30: * <p>
31: * Defaults ot {@link org.eclipse.kapua.model.query.predicate.AttributePredicate.Operator#EQUAL}
32: *
33: * @param attributeName The name of {@link org.eclipse.kapua.model.KapuaEntityAttributes} to set into the {@link AttributePredicate}.
34: * @param attributeValue The value of {@link org.eclipse.kapua.model.KapuaEntityAttributes} to set into the {@link AttributePredicate}.
35: * @since 1.0.0
36: */
37: public AttributePredicateImpl(String attributeName, T attributeValue) {
38: this(attributeName, attributeValue, Operator.EQUAL);
39: }
40:
41: /**
42: * Constructor.
43: *
44: * @param attributeName The name of {@link org.eclipse.kapua.model.KapuaEntityAttributes} to set into the {@link AttributePredicate}.
45: * @param attributeValue The value of {@link org.eclipse.kapua.model.KapuaEntityAttributes} to set into the {@link AttributePredicate}.
46: * @param operator The {@link org.eclipse.kapua.model.query.predicate.AttributePredicate.Operator} to set into the {@link AttributePredicate}.
47: * @since 1.0.0
48: */
49: public AttributePredicateImpl(String attributeName, T attributeValue, Operator operator) {
50: this.attributeName = attributeName;
51: this.attributeValue = attributeValue;
52: this.operator = operator;
53: }
54:
55: @Override
56: public String getAttributeName() {
57: return attributeName;
58: }
59:
60: @Override
61: public T getAttributeValue() {
62: return attributeValue;
63: }
64:
65: @Override
66: public Operator getOperator() {
67: return operator;
68: }
69:
70: }