diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs index 958cb7383d..022858c29d 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/layer.java.ejs @@ -82,6 +82,7 @@ public class <%- camelize(type) %>Layer extends Layer { * @param sourceLayer the source layer to set * @return This */ + @NonNull public <%- camelize(type) %>Layer withSourceLayer(String sourceLayer) { setSourceLayer(sourceLayer); return this; @@ -94,6 +95,7 @@ public class <%- camelize(type) %>Layer extends Layer { * * @return id of the source */ + @NonNull public String getSourceId() { checkThread(); return nativeGetSourceId(); @@ -106,6 +108,7 @@ public class <%- camelize(type) %>Layer extends Layer { * * @return sourceLayer the source layer to get */ + @NonNull public String getSourceLayer() { checkThread(); return nativeGetSourceLayer(); @@ -116,7 +119,7 @@ public class <%- camelize(type) %>Layer extends Layer { * * @param filter the expression filter to set */ - public void setFilter(Expression filter) { + public void setFilter(@NonNull Expression filter) { checkThread(); nativeSetFilter(filter.toArray()); } @@ -127,7 +130,8 @@ public class <%- camelize(type) %>Layer extends Layer { * @param filter the expression filter to set * @return This */ - public <%- camelize(type) %>Layer withFilter(Expression filter) { + @NonNull + public <%- camelize(type) %>Layer withFilter(@NonNull Expression filter) { setFilter(filter); return this; } @@ -155,6 +159,7 @@ public class <%- camelize(type) %>Layer extends Layer { * @param properties the var-args properties * @return This */ + @NonNull public <%- camelize(type) %>Layer withProperties(@NonNull PropertyValue<?>... properties) { setProperties(properties); return this; @@ -168,6 +173,7 @@ public class <%- camelize(type) %>Layer extends Layer { * * @return property wrapper value around <%- propertyType(property) %> */ + @NonNull @SuppressWarnings("unchecked") public PropertyValue<<%- propertyType(property) %>> get<%- camelize(property.name) %>() { checkThread(); @@ -199,6 +205,7 @@ public class <%- camelize(type) %>Layer extends Layer { * * @return transition options for <%- propertyType(property) %> */ + @NonNull public TransitionOptions get<%- camelize(property.name) %>Transition() { checkThread(); return nativeGet<%- camelize(property.name) %>Transition(); @@ -209,7 +216,7 @@ public class <%- camelize(type) %>Layer extends Layer { * * @param options transition options for <%- propertyType(property) %> */ - public void set<%- camelize(property.name) %>Transition(TransitionOptions options) { + public void set<%- camelize(property.name) %>Transition(@NonNull TransitionOptions options) { checkThread(); nativeSet<%- camelize(property.name) %>Transition(options.getDuration(), options.getDelay()); } @@ -217,10 +224,12 @@ public class <%- camelize(type) %>Layer extends Layer { <% } -%> <% for (const property of properties) { -%> + @NonNull @Keep private native Object nativeGet<%- camelize(property.name) %>(); <% if (property.transition) { -%> + @NonNull @Keep private native TransitionOptions nativeGet<%- camelize(property.name) %>Transition(); |