class PrimaryLock extends ThemisLock {

  @Override
  public boolean equals(Object object) {
    if (!(object instanceof PrimaryLock)) {
      return false;
    }
    PrimaryLock lock = (PrimaryLock)object;
    if (!super.equals((ThemisLock)lock)) {
      return false;
    }
    if (!lock.isPrimary()) {
      return false;
    }
    if (this.secondaryColumns.size() != lock.secondaryColumns.size()) {
      return false;
    }
    for (Entry<ColumnCoordinate, Type> columnAndType : secondaryColumns.entrySet()) {
      Type type = lock.secondaryColumns.get(columnAndType.getKey());
      if (type == null || !columnAndType.getValue().equals(type)) {
        return false;
      }
    }
    return true;
  }

  public  PrimaryLock();
  public  PrimaryLock(Type type);

}