• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CyclopsMC / IntegratedDynamics / 20210191346

14 Dec 2025 03:32PM UTC coverage: 19.514% (-33.5%) from 53.061%
20210191346

push

github

rubensworks
Remove deprecations

663 of 8728 branches covered (7.6%)

Branch coverage included in aggregate %.

6786 of 29445 relevant lines covered (23.05%)

1.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/org/cyclops/integrateddynamics/api/advancement/criterion/ValuePredicate.java
1
package org.cyclops.integrateddynamics.api.advancement.criterion;
2

3
import com.google.gson.JsonElement;
4
import org.cyclops.integrateddynamics.api.evaluate.variable.IValue;
5
import org.cyclops.integrateddynamics.api.evaluate.variable.IValueType;
6
import org.cyclops.integrateddynamics.core.evaluate.variable.ValueHelpers;
7

8
import java.util.Optional;
9

10
/**
11
 * A predicate for values of a certain type.
12
 * @author rubensworks
13
 */
14
public class ValuePredicate<V extends IValue> {
15

16
    public static final ValuePredicate ANY = new ValuePredicate<>(Optional.empty(), Optional.empty(), Optional.empty());
×
17

18
    private final Optional<IValueType> valueType;
19
    private final Optional<IValue> value;
20
    private final Optional<JsonElement> valueJson;
21

22
    public ValuePredicate(Optional<IValueType> valueType, Optional<IValue> value, Optional<JsonElement> valueJson) {
×
23
        this.valueType = valueType;
×
24
        this.value = value;
×
25
        this.valueJson = valueJson;
×
26
    }
×
27

28
    public Optional<IValueType> getValueType() {
29
        return valueType;
×
30
    }
31

32
    public Optional<IValue> getValue() {
33
        return value;
×
34
    }
35

36
    public Optional<JsonElement> getValueJson() {
37
        return valueJson;
×
38
    }
39

40
    public final boolean test(IValue value) {
41
        return (this.value.isEmpty() || ValueHelpers.areValuesEqual(this.value.get(), value))
×
42
                && (this.valueType.isEmpty() || value.getType() == this.valueType.get()) && testTyped((V) value);
×
43
    }
44

45
    protected boolean testTyped(V value) {
46
        return true;
×
47
    }
48

49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc