aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/prelude/semantics/rule/SuperCondition.java
blob: aa845ca2c43d31cf4a1756b89c2b06101f41ee06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.semantics.rule;

import com.yahoo.prelude.semantics.engine.RuleEvaluation;

/**
 * A condition which evaluates the <i>last included</i> version of
 * the named condition this is a premise of.
 *
 * @author bratseth
 */
public class SuperCondition extends Condition {

    private Condition condition;

    public void setCondition(Condition condition) {
        this.condition=condition;
    }

    public Condition getCondition() {
        return condition;
    }

    public boolean doesMatch(RuleEvaluation e) {
        return condition.matches(e);
    }

    public String toInnerString() {
        if (condition==null)
            return "@super";
        else
            return condition.toString();
    }


}