Download this file

GoogleMatrixDistance.java    65 lines (48 with data), 1.5 kB

 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package eu.alfred.recommendationengine.model;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
/**
* Created by tobias on 2/1/16.
*/
@Document(collection = "GoogleMatrixDistance")
public class GoogleMatrixDistance {
@Field("distance")
private double distance;
@Field("durationMinutes")
private double durationMinutes;
@Field("distanceType")
private DistanceType distanceType;
@Field("_id")
private String _id;
public GoogleMatrixDistance(double distance, double durationMinutes, DistanceType distanceType) {
this.distance = distance;
this.durationMinutes = durationMinutes;
this.distanceType = distanceType;
}
public GoogleMatrixDistance(String _id,double distance, double durationMinutes, DistanceType distanceType) {
this._id = _id;
this.distance = distance;
this.durationMinutes = durationMinutes;
this.distanceType = distanceType;
}
public DistanceType getDistanceType() {
return distanceType;
}
public double getDurationMinutes() {
return durationMinutes;
}
public double getDistance() {
return distance;
}
@Override
public String toString()
{
return ""+getDistance()+getDistanceType().toString()+", "+getDurationMinutes()+" min.";
}
public String get_id() {
return _id;
}
public void set_id(String _id) {
this._id = _id;
}
}