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

io.github.vmzakharov.ecdataframe.dsl.PropertyPathExpr Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
package io.github.vmzakharov.ecdataframe.dsl;

import io.github.vmzakharov.ecdataframe.dsl.value.Value;
import io.github.vmzakharov.ecdataframe.dsl.visitor.ExpressionEvaluationVisitor;
import io.github.vmzakharov.ecdataframe.dsl.visitor.ExpressionVisitor;
import org.eclipse.collections.api.RichIterable;
import org.eclipse.collections.api.list.ListIterable;

public class PropertyPathExpr
implements Expression
{
    private ListIterable pathElements;

    public PropertyPathExpr(ListIterable pathElements)
    {
        this.pathElements = pathElements;
    }

    @Override
    public Value evaluate(ExpressionEvaluationVisitor visitor)
    {
        return visitor.visitPropertyPathExpr(this);
    }

    @Override
    public void accept(ExpressionVisitor visitor)
    {
        visitor.visitPropertyPathExpr(this);
    }

    public RichIterable getPathElements()
    {
        return this.pathElements;
    }

    public String getEntityName()
    {
        return this.pathElements.get(0);
    }

    public String getPropertyChainString()
    {
        return this.pathElements.drop(1).makeString(".");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy