Skip to content

Package: TrueConditionService

TrueConditionService

nameinstructionbranchcomplexitylinemethod
TrueConditionService()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
evaluate(True, EObject)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
evaluateChangedValues(True, EObject, Map)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getConditionSettings(True, EObject)
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getConditionType()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getDomainModelReferences(True)
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2017 Christian W. Damus and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Christian W. Damus - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.internal.rule;
15:
16: import java.util.Collections;
17: import java.util.Map;
18: import java.util.Set;
19:
20: import org.eclipse.emf.ecore.EClass;
21: import org.eclipse.emf.ecore.EObject;
22: import org.eclipse.emf.ecore.EStructuralFeature.Setting;
23: import org.eclipse.emf.ecp.common.spi.UniqueSetting;
24: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
25: import org.eclipse.emf.ecp.view.spi.rule.ConditionService;
26: import org.eclipse.emf.ecp.view.spi.rule.model.RulePackage;
27: import org.eclipse.emf.ecp.view.spi.rule.model.True;
28: import org.osgi.service.component.annotations.Component;
29:
30: /**
31: * A trivial condition service for the {@link True} condition.
32: *
33: * @author Christian W. Damus
34: */
35: @Component
36: public class TrueConditionService implements ConditionService<True> {
37:
38:         /**
39:          * Initializes me.
40:          */
41:         public TrueConditionService() {
42:                 super();
43:         }
44:
45:         @Override
46:         public EClass getConditionType() {
47:                 return RulePackage.Literals.TRUE;
48:         }
49:
50:         @Override
51:         public boolean evaluate(True condition, EObject domainModel) {
52:                 return condition.evaluate(domainModel);
53:         }
54:
55:         @Override
56:         public boolean evaluateChangedValues(True condition, EObject domainModel, Map<Setting, Object> possibleNewValues) {
57:                 return condition.evaluateChangedValues(domainModel, possibleNewValues);
58:         }
59:
60:         @Override
61:         public Set<VDomainModelReference> getDomainModelReferences(True condition) {
62:                 return Collections.emptySet(); // It's a literal value, not really a condition
63:         }
64:
65:         @Override
66:         public Set<UniqueSetting> getConditionSettings(True condition, EObject domainModel) {
67:                 return Collections.emptySet(); // It's a literal value, not really a condition
68:         }
69:
70: }