blob: 4369a245fc78abe70f1596dd89b1fbff2dfa99e4 (
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
|
// 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 is always true, and which has its own value as return value
*
* @author bratseth
*/
public class LiteralCondition extends Condition {
private String value;
public LiteralCondition(String value) {
this.value=value;
}
protected boolean doesMatch(RuleEvaluation e) {
e.setValue(value);
return true;
}
public void setValue(String value) { this.value=value; }
public String getValue() { return value; }
public String toInnerString() { return "'" + value + "'"; }
}
|