19
19
import java .util .Collections ;
20
20
import java .util .HashMap ;
21
21
import java .util .Map ;
22
+ import java .util .Optional ;
22
23
23
24
import static java .util .Optional .ofNullable ;
24
25
@@ -39,7 +40,7 @@ public AndroidGeoLocation() {
39
40
/**
40
41
* Initializes AndroidLocation instance with longitude and latitude values.
41
42
*
42
- * @param latitude latitude value
43
+ * @param latitude latitude value
43
44
* @param longitude longitude value
44
45
*/
45
46
public AndroidGeoLocation (double latitude , double longitude ) {
@@ -111,10 +112,10 @@ public AndroidGeoLocation withSpeed(double speed) {
111
112
*/
112
113
public Map <String , ?> build () {
113
114
var map = new HashMap <String , Object >();
114
- ofNullable ( longitude ). map ( x -> map .put ("longitude" , x ) ).orElseThrow (() -> new IllegalArgumentException (
115
- "A valid 'longitude' must be provided" ));
116
- ofNullable ( latitude ). map ( x -> map .put ("latitude" , x ) ).orElseThrow (() -> new IllegalArgumentException (
117
- "A valid 'latitude' must be provided" ));
115
+ map .put ("longitude" , ofNullable ( longitude ).orElseThrow (() -> new IllegalArgumentException (
116
+ "A valid 'longitude' must be provided" ))) ;
117
+ map .put ("latitude" , ofNullable ( latitude ).orElseThrow (() -> new IllegalArgumentException (
118
+ "A valid 'latitude' must be provided" ))) ;
118
119
ofNullable (altitude ).ifPresent (x -> map .put ("altitude" , x ));
119
120
ofNullable (satellites ).ifPresent (x -> map .put ("satellites" , x ));
120
121
ofNullable (speed ).ifPresent (x -> map .put ("speed" , x ));
0 commit comments