<commit_before>package com.continuuity.metrics.query;

/**
 * class to identify a unique timeseries, which is a 4 tuple of context, metric, tag, and runid.
 */
public final class TimeseriesId {
  private final String context;
  private final String metric;
  private final String tag;
  private final String runId;

  public TimeseriesId(String context, String metric, String tag, String runId) {
    this.context = context;
    this.metric = metric;
    this.tag = tag;
    this.runId = runId;
  }

  @Override
  public boolean equals(Object o) {
    if (!(o instanceof TimeseriesId) || o == null) {
      return false;
    }
    TimeseriesId other = (TimeseriesId) o;
    return context.equals(other.context) && metric.equals(other.metric)
      && (tag == null) ? (other.tag == null) : tag.equals(other.tag)
      && (runId == null) ? (other.runId == null) : runId.equals(other.runId);
  }

  @Override
  public int hashCode() {
    int hash = context.hashCode();
    hash = 31 * hash + metric.hashCode();
    hash = 31 * hash + ((tag == null) ? 0 : tag.hashCode());
    hash = 31 * hash + ((runId == null) ? 0 : runId.hashCode());
    return hash;
  }
}<commit_msg>cleaning up some code for equals and hashcode<commit_after>package com.continuuity.metrics.query;

import com.google.common.base.Objects;

/**
 * class to identify a unique timeseries, which is a 4 tuple of context, metric, tag, and runid.
 */
public final class TimeseriesId {
  private final String context;
  private final String metric;
  private final String tag;
  private final String runId;

  public TimeseriesId(String context, String metric, String tag, String runId) {
    this.context = context;
    this.metric = metric;
    this.tag = tag;
    this.runId = runId;
  }

  @Override
  public boolean equals(Object o) {
    if (!(o instanceof TimeseriesId) || o == null) {
      return false;
    }
    TimeseriesId other = (TimeseriesId) o;
    return Objects.equal(context, other.context) &&
      Objects.equal(metric, other.metric) &&
      Objects.equal(tag, other.tag) &&
      Objects.equal(runId, other.runId);
  }

  @Override
  public int hashCode() {
    return Objects.hashCode(context, metric, tag, runId);
  }

  @Override
  public String toString() {
    return Objects.toStringHelper(this)
      .add("context", context)
      .add("metric", metric)
      .add("tag", tag)
      .add("runId", runId)
      .toString();
  }
}
{'fraction_non_alphanumeric': 0.12432878975629905, 'fraction_numerical': 0.004130524576621231, 'mean_word_length': 3.1472602739726026, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6962289', 'n_tokens_mistral': 764, 'n_tokens_neox': 740, 'n_words': 228}