package de.ivu.elect.business.system.control;

import java.io.Serializable;

/**
 *  on 04.01.2017.
 */
public class ElectMultipleCronTimerKey implements Serializable {

  private final Class clazz;

  private final Serializable payload;

  public ElectMultipleCronTimerKey(Class clazz, Serializable payload) {
    this.clazz = clazz;
    this.payload = payload;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    ElectMultipleCronTimerKey that = (ElectMultipleCronTimerKey) o;

    if (clazz != null ? !clazz.equals(that.clazz) : that.clazz != null) return false;
    return payload != null ? payload.equals(that.payload) : that.payload == null;
  }

  @Override
  public int hashCode() {
    int result = clazz != null ? clazz.hashCode() : 0;
    result = 31 * result + (payload != null ? payload.hashCode() : 0);
    return result;
  }

  @Override
  public String toString() {
    return "ElectMultipleCronTimerKey{" +
        "clazz=" + clazz +
        ", payload=" + payload +
        '}';
  }
}

