Skip to content

Commit 53b4a86

Browse files
committed
WIP: use primitives and improve documentation
1 parent 69e3e4f commit 53b4a86

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/main/java/com/flowingcode/vaadin/addons/googlemaps/GeolocationOptions.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,20 @@ public class GeolocationOptions {
4141
* If true and if the device is able to provide a more accurate position, it will do so. This may
4242
* result in slower response times or increased power consumption.
4343
*/
44-
private Boolean enableHighAccuracy;
44+
private boolean enableHighAccuracy;
4545

4646
/**
4747
* A positive long value representing the maximum length of time (in milliseconds) the device is
48-
* allowed to take in order to return a position.
48+
* allowed to take in order to return a position.
49+
* If null, the device won't timeout until the position is available.
4950
*/
5051
private Long timeout;
5152

5253
/**
5354
* A positive long value representing the maximum age (in milliseconds) of a possible cached
5455
* position that is acceptable to return.
5556
*/
56-
private Long maximumAge;
57+
private long maximumAge;
5758

5859
/**
5960
* Converts the options to a JsonObject to be sent to the client-side.
@@ -62,15 +63,11 @@ public class GeolocationOptions {
6263
*/
6364
public JsonObject toJson() {
6465
JsonObject json = Json.createObject();
65-
if (enableHighAccuracy != null) {
66-
json.put("enableHighAccuracy", enableHighAccuracy);
67-
}
66+
json.put("enableHighAccuracy", enableHighAccuracy);
67+
json.put("maximumAge", maximumAge);
6868
if (timeout != null) {
6969
json.put("timeout", timeout);
7070
}
71-
if (maximumAge != null) {
72-
json.put("maximumAge", maximumAge);
73-
}
7471
return json;
7572
}
7673
}

0 commit comments

Comments
 (0)