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

org.molgenis.data.security.aggregation.AnonymizedAggregateResult Maven / Gradle / Ivy

There is a newer version: 8.4.5
Show newest version
package org.molgenis.data.security.aggregation;

import java.util.List;
import java.util.Objects;
import org.molgenis.data.aggregation.AggregateResult;

public class AnonymizedAggregateResult extends AggregateResult {
  public static final long AGGREGATE_ANONYMIZATION_VALUE = -1;

  private final int anonymizationThreshold;

  AnonymizedAggregateResult(
      List> matrix,
      List xLabels,
      List yLabels,
      int anonymizationThreshold) {
    super(matrix, xLabels, yLabels);
    this.anonymizationThreshold = anonymizationThreshold;
  }

  public int getAnonymizationThreshold() {
    return anonymizationThreshold;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (!(o instanceof AnonymizedAggregateResult)) {
      return false;
    }
    if (!super.equals(o)) {
      return false;
    }
    AnonymizedAggregateResult that = (AnonymizedAggregateResult) o;
    return getAnonymizationThreshold() == that.getAnonymizationThreshold();
  }

  @Override
  public int hashCode() {
    return Objects.hash(super.hashCode(), getAnonymizationThreshold());
  }
}