1919import java .util .Collections ;
2020import java .util .HashMap ;
2121import java .util .Map ;
22+ import java .util .Optional ;
2223
2324import static java .util .Optional .ofNullable ;
2425
@@ -39,7 +40,7 @@ public AndroidGeoLocation() {
3940 /**
4041 * Initializes AndroidLocation instance with longitude and latitude values.
4142 *
42- * @param latitude latitude value
43+ * @param latitude latitude value
4344 * @param longitude longitude value
4445 */
4546 public AndroidGeoLocation (double latitude , double longitude ) {
@@ -111,10 +112,10 @@ public AndroidGeoLocation withSpeed(double speed) {
111112 */
112113 public Map <String , ?> build () {
113114 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" ))) ;
118119 ofNullable (altitude ).ifPresent (x -> map .put ("altitude" , x ));
119120 ofNullable (satellites ).ifPresent (x -> map .put ("satellites" , x ));
120121 ofNullable (speed ).ifPresent (x -> map .put ("speed" , x ));
0 commit comments