aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/main/java/com/yahoo/document/select/convert/NowQueryNode.java
blob: ee53093fdc40c0a62e4583f0306797caa989b159 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.document.select.convert;

import com.yahoo.document.select.rule.ArithmeticNode;

/**
 * Represents the now node in a query expression.
 *
 * @author Ulf Lilleengen
 */
public class NowQueryNode {
    private final long value;
    NowQueryNode(long value) {
        this.value = value;
    }
    NowQueryNode(ArithmeticNode node) {
        // Assumes that the structure is checked and verified earlier
        this.value = Long.parseLong(node.getItems().get(1).getNode().toString());
    }
    @Override
    public String toString() {
        return "now(" + this.value + ")";
    }
}