All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fr.insee.vtl.model.ConstantExpression Maven / Gradle / Ivy

package fr.insee.vtl.model;

import java.util.Map;

public class ConstantExpression extends ResolvableExpression {

    private final Object value;

    public ConstantExpression(Object value, Positioned position) {
        super(position);
        this.value = value;
    }

    @Override
    public Object resolve(Map context) {
        return value;
    }

    @Override
    public Class getType() {
        // TODO: Use expr == Constant.NULL instead.
        if (value == null) {
            return Object.class;
        }
        return value.getClass();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy