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

io.edurt.datacap.parser.tree.join.JoinUsing Maven / Gradle / Ivy

There is a newer version: 2024.4.1
Show newest version
package io.edurt.datacap.parser.tree.join;

import com.google.common.collect.ImmutableList;
import io.edurt.datacap.parser.node.Node;
import io.edurt.datacap.parser.tree.Identifier;

import java.util.List;
import java.util.Objects;

import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;

public class JoinUsing
        extends JoinCriteria
{
    private final List columns;

    public JoinUsing(List columns)
    {
        requireNonNull(columns, "columns is null");
        checkArgument(!columns.isEmpty(), "columns is empty");
        this.columns = ImmutableList.copyOf(columns);
    }

    public List getColumns()
    {
        return columns;
    }

    @Override
    public boolean equals(Object obj)
    {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        JoinUsing o = (JoinUsing) obj;
        return Objects.equals(columns, o.columns);
    }

    @Override
    public int hashCode()
    {
        return Objects.hash(columns);
    }

    @Override
    public String toString()
    {
        return toStringHelper(this)
                .addValue(columns)
                .toString();
    }

    @Override
    public List getNodes()
    {
        return ImmutableList.of();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy