You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
652 B
34 lines
652 B
package base;
|
|
|
|
import java.util.Objects;
|
|
|
|
public class GasStation {
|
|
private String name;
|
|
private int id;
|
|
|
|
public GasStation(String name, int id) {
|
|
this.name = name;
|
|
this.id = id;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if(this == o) { return true; }
|
|
if(o == null || getClass() != o.getClass()) { return false; }
|
|
GasStation station = (GasStation) o;
|
|
return id == station.id;
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(id);
|
|
}
|
|
}
|
|
|