Код: Выделить всё
public class Driver {
String name;
String surname;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
@Override
public final boolean equals(Object o) {
boolean equals = true;
equals &= o.getClass() == this.getClass();
equals &= ((Driver)o).getName().equals(this.getName());
equals &= ((Driver)o).getSurname().equals(this.getSurname());
return equals;
}
@Override
public final int hashCode() {
int result = 0;
result = result+(name!=null ? name.hashCode():0);
result = result+(surname!=null ? surname.hashCode():0);
return result;
}
}
Код: Выделить всё
//I get the map via the parameters: Map> map
//There is a entry, with the right driver
if (map.get(driver) == null) {
.
.
.
}
Запись с ключом не найдена, хотя он там 100%
Подробнее здесь: https://stackoverflow.com/questions/785 ... not-called
Мобильная версия