io.openlineage.sql.ColumnLineage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openlineage-sql-java Show documentation
Show all versions of openlineage-sql-java Show documentation
Java bindings to OpenLineage SQL parser
/*
/* Copyright 2018-2024 contributors to the OpenLineage project
/* SPDX-License-Identifier: Apache-2.0
*/
package io.openlineage.sql;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.lang3.builder.HashCodeBuilder;
public class ColumnLineage {
private final ColumnMeta descendant;
private final List lineage;
public ColumnLineage(ColumnMeta descendant, List lineage) {
this.descendant = descendant;
this.lineage = lineage;
}
public ColumnMeta descendant() {
return descendant;
}
public List lineage() {
return lineage;
}
@Override
public String toString() {
return String.format(
"{\"descendant\": %s, \"lineage\": %s}",
descendant.toString(), Arrays.toString(lineage.toArray()));
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (!(o instanceof ColumnLineage)) {
return false;
}
ColumnLineage other = (ColumnLineage) o;
return other.descendant.equals(descendant) && other.lineage.equals(lineage);
}
@Override
public int hashCode() {
return new HashCodeBuilder().append(descendant).append(lineage).toHashCode();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy