aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/main/java/com/yahoo/searchlib/treenet/rule/Response.java
blob: 7b45715114eab398e5237f15b01b82a8b37d95af (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
37
38
39
40
41
42
43
44
45
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchlib.treenet.rule;

/**
 * @author Simon Thoresen Hult
 */
public class Response extends TreeNode {

    // The id of the next tree to run after this.
    private final Double value;

    // The value of this response.
    private final String next;

    /**
     * Constructs a new response.
     *
     * @param next  The id of the next tree to run after this.
     * @param value The value of this response.
     */
    public Response(Double value, String next) {
        super();
        this.value = value;
        this.next = next;
    }

    /**
     * Returns the value of this response.
     */
    public Double getValue() {
        return value;
    }

    /**
     * Returns the id of the next tree to run after this.
     */
    public String getNext() {
        return next;
    }

    @Override
    public String toRankingExpression() {
        return value.toString();
    }
}