diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources')
10 files changed, 9 insertions, 42 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.java index cfb46b0cec..a44d7cab1a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySource.java @@ -129,7 +129,6 @@ public class CustomGeometrySource extends Source { @Keep protected native void initialize(String sourceId, Object options); - @NonNull @Keep private native Feature[] querySourceFeatures(Object[] filter); @@ -180,7 +179,7 @@ public class CustomGeometrySource extends Source { } } - private void executeRequest(@NonNull GeometryTileRequest request) { + private void executeRequest(GeometryTileRequest request) { executorLock.lock(); try { if (executor != null && !executor.isShutdown()) { @@ -236,7 +235,6 @@ public class CustomGeometrySource extends Source { final AtomicInteger threadCount = new AtomicInteger(); final int poolId = poolCount.getAndIncrement(); - @NonNull @Override public Thread newThread(@NonNull Runnable runnable) { return new Thread( @@ -279,7 +277,7 @@ public class CustomGeometrySource extends Source { return Arrays.hashCode(new int[] {z, x, y}); } - public boolean equals(@Nullable Object object) { + public boolean equals(Object object) { if (object == this) { return true; } @@ -301,7 +299,6 @@ public class CustomGeometrySource extends Source { private final GeometryTileProvider provider; private final Map<TileID, GeometryTileRequest> awaiting; private final Map<TileID, AtomicBoolean> inProgress; - @NonNull private final WeakReference<CustomGeometrySource> sourceRef; private final AtomicBoolean cancelled; @@ -365,7 +362,7 @@ public class CustomGeometrySource extends Source { } @Override - public boolean equals(@Nullable Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySourceOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySourceOptions.java index 92c0881c74..4ada38c238 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySourceOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/CustomGeometrySourceOptions.java @@ -1,7 +1,5 @@ package com.mapbox.mapboxsdk.style.sources; -import android.support.annotation.NonNull; - /** * Builder class for composing CustomGeometrySource objects. */ @@ -13,7 +11,6 @@ public class CustomGeometrySourceOptions extends GeoJsonOptions { * @param wrap defaults to false * @return the current instance for chaining */ - @NonNull public CustomGeometrySourceOptions withWrap(boolean wrap) { this.put("wrap", wrap); return this; @@ -26,7 +23,6 @@ public class CustomGeometrySourceOptions extends GeoJsonOptions { * @param clip defaults to false * @return the current instance for chaining */ - @NonNull public CustomGeometrySourceOptions withClip(boolean clip) { this.put("clip", clip); return this; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.java index 1e1b9bafa6..00715bc213 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonOptions.java @@ -1,7 +1,5 @@ package com.mapbox.mapboxsdk.style.sources; -import android.support.annotation.NonNull; - import java.util.HashMap; /** @@ -18,7 +16,6 @@ public class GeoJsonOptions extends HashMap<String, Object> { * @param minZoom the minimum zoom - Defaults to 0. * @return the current instance for chaining */ - @NonNull public GeoJsonOptions withMinZoom(int minZoom) { this.put("minzoom", minZoom); return this; @@ -30,7 +27,6 @@ public class GeoJsonOptions extends HashMap<String, Object> { * @param maxZoom the maximum zoom - Defaults to 25.5 * @return the current instance for chaining */ - @NonNull public GeoJsonOptions withMaxZoom(int maxZoom) { this.put("maxzoom", maxZoom); return this; @@ -43,7 +39,6 @@ public class GeoJsonOptions extends HashMap<String, Object> { * @param buffer the buffer size - Defaults to 128. * @return the current instance for chaining */ - @NonNull public GeoJsonOptions withBuffer(int buffer) { this.put("buffer", buffer); return this; @@ -55,7 +50,6 @@ public class GeoJsonOptions extends HashMap<String, Object> { * @param lineMetrics true to calculate line distance metrics. * @return the current instance for chaining */ - @NonNull public GeoJsonOptions withLineMetrics(boolean lineMetrics) { this.put("lineMetrics", lineMetrics); return this; @@ -67,7 +61,6 @@ public class GeoJsonOptions extends HashMap<String, Object> { * @param tolerance the tolerance - Defaults to 0.375 * @return the current instance for chaining */ - @NonNull public GeoJsonOptions withTolerance(float tolerance) { this.put("tolerance", tolerance); return this; @@ -79,7 +72,6 @@ public class GeoJsonOptions extends HashMap<String, Object> { * @param cluster cluster? - Defaults to false * @return the current instance for chaining */ - @NonNull public GeoJsonOptions withCluster(boolean cluster) { this.put("cluster", cluster); return this; @@ -92,7 +84,6 @@ public class GeoJsonOptions extends HashMap<String, Object> { * zoom features are not clustered) * @return the current instance for chaining */ - @NonNull public GeoJsonOptions withClusterMaxZoom(int clusterMaxZoom) { this.put("clusterMaxZoom", clusterMaxZoom); return this; @@ -104,7 +95,6 @@ public class GeoJsonOptions extends HashMap<String, Object> { * @param clusterRadius cluster radius - Defaults to 50 * @return the current instance for chaining */ - @NonNull public GeoJsonOptions withClusterRadius(int clusterRadius) { this.put("clusterRadius", clusterRadius); return this; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.java index a9eb43f968..2d9b1c985a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/GeoJsonSource.java @@ -62,7 +62,7 @@ public class GeoJsonSource extends Source { * @param id the source id * @param geoJson raw Json FeatureCollection */ - public GeoJsonSource(String id, @Nullable String geoJson) { + public GeoJsonSource(String id, String geoJson) { super(); if (geoJson == null || geoJson.startsWith("http")) { throw new IllegalArgumentException("Expected a raw json body"); @@ -78,7 +78,7 @@ public class GeoJsonSource extends Source { * @param geoJson raw Json body * @param options options */ - public GeoJsonSource(String id, @Nullable String geoJson, GeoJsonOptions options) { + public GeoJsonSource(String id, String geoJson, GeoJsonOptions options) { super(); if (geoJson == null || geoJson.startsWith("http")) { throw new IllegalArgumentException("Expected a raw json body"); @@ -236,7 +236,7 @@ public class GeoJsonSource extends Source { * * @param url the GeoJSON FeatureCollection url */ - public void setUrl(@NonNull URL url) { + public void setUrl(URL url) { checkThread(); setUrl(url.toExternalForm()); } @@ -279,7 +279,6 @@ public class GeoJsonSource extends Source { @Keep protected native void nativeSetUrl(String url); - @NonNull @Keep protected native String nativeGetUrl(); @@ -295,7 +294,6 @@ public class GeoJsonSource extends Source { @Keep private native void nativeSetGeometry(Geometry geometry); - @NonNull @Keep private native Feature[] querySourceFeatures(Object[] filter); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/ImageSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/ImageSource.java index 2579c95870..d0ca5e050b 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/ImageSource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/ImageSource.java @@ -46,7 +46,7 @@ public class ImageSource extends Source { * @param coordinates The Latitude and Longitude of the four corners of the image * @param url remote json file */ - public ImageSource(String id, LatLngQuad coordinates, @NonNull URL url) { + public ImageSource(String id, LatLngQuad coordinates, URL url) { super(); initialize(id, coordinates); setUrl(url); @@ -83,7 +83,7 @@ public class ImageSource extends Source { * * @param url An Image url */ - public void setUrl(@NonNull URL url) { + public void setUrl(URL url) { setUrl(url.toExternalForm()); } @@ -149,7 +149,6 @@ public class ImageSource extends Source { @Keep protected native void nativeSetUrl(String url); - @NonNull @Keep protected native String nativeGetUrl(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterDemSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterDemSource.java index 6bc6d40287..4c2b39375a 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterDemSource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterDemSource.java @@ -1,7 +1,6 @@ package com.mapbox.mapboxsdk.style.sources; import android.support.annotation.Keep; -import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.UiThread; @@ -98,7 +97,6 @@ public class RasterDemSource extends Source { @Keep protected native void finalize() throws Throwable; - @NonNull @Keep protected native String nativeGetUrl(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterSource.java index 1390a1c055..dac9b02166 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterSource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/RasterSource.java @@ -1,7 +1,6 @@ package com.mapbox.mapboxsdk.style.sources; import android.support.annotation.Keep; -import android.support.annotation.NonNull; import android.support.annotation.Nullable; import java.net.URL; @@ -97,7 +96,6 @@ public class RasterSource extends Source { @Keep protected native void finalize() throws Throwable; - @NonNull @Keep protected native String nativeGetUrl(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/Source.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/Source.java index 44f4a6c344..14d9ef1cc5 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/Source.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/Source.java @@ -2,7 +2,6 @@ package com.mapbox.mapboxsdk.style.sources; import android.support.annotation.Keep; -import android.support.annotation.NonNull; import com.mapbox.mapboxsdk.utils.ThreadUtils; /** @@ -40,7 +39,6 @@ public abstract class Source { * * @return the source id */ - @NonNull public String getId() { checkThread(); return nativeGetId(); @@ -54,7 +52,6 @@ public abstract class Source { * * @return the string representation of the attribution in html format */ - @NonNull public String getAttribution() { checkThread(); return nativeGetAttribution(); @@ -69,11 +66,9 @@ public abstract class Source { return nativePtr; } - @NonNull @Keep protected native String nativeGetId(); - @NonNull @Keep protected native String nativeGetAttribution(); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/TileSet.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/TileSet.java index 1e4be24189..25df2d91e7 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/TileSet.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/TileSet.java @@ -1,6 +1,5 @@ package com.mapbox.mapboxsdk.style.sources; -import android.support.annotation.NonNull; import android.support.annotation.Size; import com.mapbox.mapboxsdk.geometry.LatLng; @@ -282,11 +281,10 @@ public class TileSet { this.center = center; } - public void setCenter(@NonNull LatLng center) { + public void setCenter(LatLng center) { this.center = new Float[] {(float) center.getLongitude(), (float) center.getLatitude()}; } - @NonNull Map<String, Object> toValueObject() { Map<String, Object> result = new HashMap<>(); result.put("tilejson", tilejson); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/VectorSource.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/VectorSource.java index 7028530f1f..5888eaa7e1 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/VectorSource.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/sources/VectorSource.java @@ -97,11 +97,9 @@ public class VectorSource extends Source { @Keep protected native void finalize() throws Throwable; - @NonNull @Keep protected native String nativeGetUrl(); - @NonNull @Keep private native Feature[] querySourceFeatures(String[] sourceLayerId, Object[] filter); |