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

io.openlineage.sql.ColumnLineage Maven / Gradle / Ivy

There is a newer version: 1.26.0
Show newest version
/*
/* 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