
package org.wso2.siddhi.query.api.query.selection.attribute;

import org.wso2.siddhi.query.api.expression.Expression;
import org.wso2.siddhi.query.api.expression.ExpressionValidator;

import java.util.Map;
import java.util.Set;

public class SimpleAttribute implements OutputAttribute {
    private String rename;
    private Expression expression;

    public SimpleAttribute(String rename, Expression expression) {
        this.rename = rename;
        this.expression = expression;
    }

    public String getRename() {
        return rename;
    }

//    @Override
//    public Attribute.Type getType() {
//        return expression.getType();
//    }

    public Expression getExpression() {
        return expression;
    }

    @Override
    public Map<String, Set<String>> getDependency() {
        return ExpressionValidator.getDependency(expression);
    }
}
