aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/Destination.java
blob: 1990d5db8b879a966f8eb543d4ba8387e41f92e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package cgeo.geocaching;

import cgeo.geocaching.location.Geopoint;

public final class Destination implements ICoordinates {

    final private long id;
    final private long date;
    final private Geopoint coords;

    public Destination(long id, long date, final Geopoint coords) {
        this.id = id;
        this.date = date;
        this.coords = coords;
    }

    public Destination(final Geopoint coords) {
        this(0, System.currentTimeMillis(), coords);
    }

    public long getDate() {
        return date;
    }

    @Override
    public Geopoint getCoords() {
        return coords;
    }

    @Override
    public int hashCode() {
        return coords.hashCode();
    }

    @Override
    public boolean equals(final Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof Destination)) {
            return false;
        }
        return ((Destination) obj).coords.equals(coords);
    }

    public long getId() {
        return id;
    }

}