package de.ivu.elect.business.statistik.entity;

import java.util.concurrent.atomic.AtomicLong;

import de.ivu.elect.jee.entity.AbstractNoPersistentEntity;

/**
 *  on 01.02.2017.
 */
public class StatistikSearchEntity extends AbstractNoPersistentEntity {

  private static final AtomicLong IDS = new AtomicLong(Long.MIN_VALUE);

  private final Long id = IDS.addAndGet(1L);

  @Override
  public Long getId() {
    return id;
  }

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

    StatistikSearchEntity that = (StatistikSearchEntity) o;

    return id != null ? id.equals(that.id) : that.id == null;
  }

  @Override
  public int hashCode() {
    return id != null ? id.hashCode() : 0;
  }
}
