/*
 * ElectoralDistrictImpl
 *
 * Created on 16.12.2008
 * Copyright (c) 2008 Kiesraad
 */
package de.ivu.wahl.result.builder;

import de.ivu.wahl.result.ElectoralDistrict;

final class ElectoralDistrictImpl implements ElectoralDistrict {
  private final String name;
  private final int number;
  private final long voteValue;
  private final Object externalKey;

  public ElectoralDistrictImpl(String name, int number, long voteValue, Object externalKey) {
    this.name = name;
    this.number = number;
    this.voteValue = voteValue;
    assert voteValue >= 1;
    this.externalKey = externalKey;
  }

  @Override
  public String getName() {
    return name;
  }

  @Override
  public int getNumber() {
    return number;
  }

  @Override
  public int compareTo(ElectoralDistrict other) {
    return Integer.compare(this.getNumber(), other.getNumber());
  }

  @Override
  public long getVoteValue() {
    return voteValue;
  }

  @Override
  public Object getExternalKey() {
    return externalKey;
  }
}
