Skip to content

Commit

Permalink
Revert Interactive features: remove generic from FeatureStateKey (#2773)
Browse files Browse the repository at this point in the history
This reverts commit 7e9039043dd7028d2868032d848f040f9df17027.
  • Loading branch information
kiryldz authored Sep 25, 2024
1 parent f8b13f4 commit c8bce8b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions extension-compose/api/Release/metalava.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ package com.mapbox.maps.extension.compose {
method public suspend Object? queryRenderedFeatures(com.mapbox.maps.RenderedQueryGeometry geometry, com.mapbox.maps.RenderedQueryOptions options, kotlin.coroutines.Continuation<? super com.mapbox.bindgen.Expected<java.lang.String,java.util.List<? extends com.mapbox.maps.QueriedRenderedFeature>>>);
method @com.mapbox.maps.MapboxExperimental public suspend <FF extends com.mapbox.maps.interactions.FeaturesetFeature<?>> Object? queryRenderedFeatures(com.mapbox.maps.RenderedQueryGeometry geometry, com.mapbox.maps.interactions.TypedFeaturesetDescriptor<?,FF> descriptor, com.mapbox.maps.extension.style.expressions.generated.Expression? filter = null, kotlin.coroutines.Continuation<? super java.util.List<? extends FF>> = null);
method @com.mapbox.maps.MapboxExperimental public suspend <FF extends com.mapbox.maps.interactions.FeaturesetFeature<?>> Object? queryRenderedFeatures(com.mapbox.maps.RenderedQueryGeometry geometry, com.mapbox.maps.interactions.TypedFeaturesetDescriptor<?,FF> descriptor, kotlin.coroutines.Continuation<? super java.util.List<? extends FF>> = null);
method @com.mapbox.maps.MapboxExperimental public suspend <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey> Object? removeFeatureState(com.mapbox.maps.interactions.FeaturesetFeature<FS> featuresetFeature, FSK? stateKey = null, kotlin.coroutines.Continuation<? super com.mapbox.bindgen.Expected<java.lang.String,com.mapbox.bindgen.None>> = null);
method @com.mapbox.maps.MapboxExperimental public suspend <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey> Object? removeFeatureState(com.mapbox.maps.interactions.FeaturesetFeature<FS> featuresetFeature, kotlin.coroutines.Continuation<? super com.mapbox.bindgen.Expected<java.lang.String,com.mapbox.bindgen.None>> = null);
method @com.mapbox.maps.MapboxExperimental public suspend <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey<FS>> Object? removeFeatureState(com.mapbox.maps.interactions.FeaturesetFeature<FS> featuresetFeature, FSK? stateKey = null, kotlin.coroutines.Continuation<? super com.mapbox.bindgen.Expected<java.lang.String,com.mapbox.bindgen.None>> = null);
method @com.mapbox.maps.MapboxExperimental public suspend <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey<FS>> Object? removeFeatureState(com.mapbox.maps.interactions.FeaturesetFeature<FS> featuresetFeature, kotlin.coroutines.Continuation<? super com.mapbox.bindgen.Expected<java.lang.String,com.mapbox.bindgen.None>> = null);
method @com.mapbox.maps.MapboxExperimental public suspend Object? resetFeatureStates(com.mapbox.maps.interactions.TypedFeaturesetDescriptor<?,?> descriptor, kotlin.coroutines.Continuation<? super com.mapbox.bindgen.Expected<java.lang.String,com.mapbox.bindgen.None>>);
method @com.mapbox.maps.MapboxExperimental public suspend <FS extends com.mapbox.maps.interactions.FeatureState> Object? setFeatureState(com.mapbox.maps.interactions.FeaturesetFeature<FS> featuresetFeature, FS state, kotlin.coroutines.Continuation<? super com.mapbox.bindgen.Expected<java.lang.String,com.mapbox.bindgen.None>>);
method public void setGesturesSettings(com.mapbox.maps.plugin.gestures.generated.GesturesSettings);
Expand Down Expand Up @@ -1270,7 +1270,7 @@ package com.mapbox.maps.extension.compose.style.interactions {
}

@com.mapbox.maps.MapboxExperimental public sealed interface FeaturesetFeatureScope {
method @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.FeaturesetFeature<FS>, FSK? stateKey = null, com.mapbox.maps.FeatureStateOperationCallback callback = FeatureStateOperationCallback({ var it: com.mapbox.bindgen.Expected<java.lang.String,com.mapbox.bindgen.None> ->
method @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey<FS>> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.FeaturesetFeature<FS>, FSK? stateKey = null, com.mapbox.maps.FeatureStateOperationCallback callback = FeatureStateOperationCallback({ var it: com.mapbox.bindgen.Expected<java.lang.String,com.mapbox.bindgen.None> ->


}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,10 @@ public class MapState internal constructor(initialGesturesSettings: GesturesSett
*/
@MapboxExperimental
@JvmOverloads
public suspend fun <FS : FeatureState, FSK : FeatureStateKey> removeFeatureState(
public suspend fun <FS, FSK> removeFeatureState(
featuresetFeature: FeaturesetFeature<FS>,
stateKey: FSK? = null,
): Expected<String, com.mapbox.bindgen.None> {
): Expected<String, com.mapbox.bindgen.None> where FS : FeatureState, FSK : FeatureStateKey<FS> {
mapboxMapFlow.filterNotNull().first().apply {
return suspendCancellableCoroutine { continuation ->
val cancelable = removeFeatureState(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public sealed interface FeaturesetFeatureScope {
* @return A [Cancelable] object that could be used to cancel the pending operation.
*/
@MapboxExperimental
public fun <FS : FeatureState, FSK : FeatureStateKey> FeaturesetFeature<FS>.removeFeatureState(
public fun <FS, FSK> FeaturesetFeature<FS>.removeFeatureState(
stateKey: FSK? = null,
callback: FeatureStateOperationCallback = FeatureStateOperationCallback { }
): Cancelable
): Cancelable where FS : FeatureState, FSK : FeatureStateKey<FS>

/**
* Reset all the feature states within a style source.
Expand Down Expand Up @@ -87,10 +87,10 @@ internal class FeaturesetFeatureScopeImpl internal constructor(private val mapbo
}

@MapboxExperimental
override fun <FS : FeatureState, FSK : FeatureStateKey> FeaturesetFeature<FS>.removeFeatureState(
override fun <FS, FSK> FeaturesetFeature<FS>.removeFeatureState(
stateKey: FSK?,
callback: FeatureStateOperationCallback
): Cancelable {
): Cancelable where FS : FeatureState, FSK : FeatureStateKey<FS> {
return mapboxMap.removeFeatureState(
featuresetFeature = this,
stateKey = stateKey,
Expand Down
6 changes: 3 additions & 3 deletions sdk-base/api/Release/metalava.txt
Original file line number Diff line number Diff line change
Expand Up @@ -734,15 +734,15 @@ package com.mapbox.maps.interactions {
method public void onFeatureState(FS state);
}

@com.mapbox.maps.MapboxExperimental public class FeatureStateKey {
method public static final com.mapbox.maps.interactions.FeatureStateKey create(String key);
@com.mapbox.maps.MapboxExperimental public class FeatureStateKey<FS extends com.mapbox.maps.interactions.FeatureState> {
method public static final com.mapbox.maps.interactions.FeatureStateKey<com.mapbox.maps.interactions.FeatureState> create(String key);
method public final String getKey();
property public final String key;
field public static final com.mapbox.maps.interactions.FeatureStateKey.Companion Companion;
}

public static final class FeatureStateKey.Companion {
method public com.mapbox.maps.interactions.FeatureStateKey create(String key);
method public com.mapbox.maps.interactions.FeatureStateKey<com.mapbox.maps.interactions.FeatureState> create(String key);
}

public final class FeatureStateKt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import java.util.Objects
* Refer to static [create] method to create an instance of [FeatureStateKey].
*/
@MapboxExperimental
open class FeatureStateKey internal constructor(
open class FeatureStateKey<FS : FeatureState> internal constructor(
/**
* The feature state key to remove from the feature.
*/
Expand All @@ -22,7 +22,7 @@ open class FeatureStateKey internal constructor(
if (this === other) return true
if (javaClass != other?.javaClass) return false

other as FeatureStateKey
other as FeatureStateKey<*>

return key == other.key
}
Expand All @@ -42,6 +42,6 @@ open class FeatureStateKey internal constructor(
* Create an instance of [FeatureStateKey] to be passed to `removeFeatureState`.
*/
@JvmStatic
fun create(key: String): FeatureStateKey = FeatureStateKey(key)
fun create(key: String): FeatureStateKey<FeatureState> = FeatureStateKey(key)
}
}
12 changes: 6 additions & 6 deletions sdk/api/Release/metalava.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,18 +259,18 @@ package com.mapbox.maps {
method public com.mapbox.common.Cancelable removeFeatureState(String sourceId, String? sourceLayerId = null, String featureId, String? stateKey = null, com.mapbox.maps.FeatureStateOperationCallback callback);
method public com.mapbox.common.Cancelable removeFeatureState(String sourceId, String? sourceLayerId = null, String featureId, com.mapbox.maps.FeatureStateOperationCallback callback);
method public com.mapbox.common.Cancelable removeFeatureState(String sourceId, String featureId, com.mapbox.maps.FeatureStateOperationCallback callback);
method @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.FeaturesetFeature<FS> featuresetFeature, FSK? stateKey = null, com.mapbox.maps.FeatureStateOperationCallback callback = FeatureStateOperationCallback({ var it: com.mapbox.bindgen.Expected<java.lang.String,com.mapbox.bindgen.None> ->
method @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey<FS>> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.FeaturesetFeature<FS> featuresetFeature, FSK? stateKey = null, com.mapbox.maps.FeatureStateOperationCallback callback = FeatureStateOperationCallback({ var it: com.mapbox.bindgen.Expected<java.lang.String,com.mapbox.bindgen.None> ->


}));
method @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.FeaturesetFeature<FS> featuresetFeature, FSK? stateKey = null);
method @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.FeaturesetFeature<FS> featuresetFeature);
method @com.mapbox.maps.MapboxDelicateApi @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.TypedFeaturesetDescriptor<FS,?> descriptor, com.mapbox.maps.FeaturesetFeatureId id, FSK? stateKey = null, com.mapbox.maps.FeatureStateOperationCallback callback = FeatureStateOperationCallback({ var it: com.mapbox.bindgen.Expected<java.lang.String,com.mapbox.bindgen.None> ->
method @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey<FS>> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.FeaturesetFeature<FS> featuresetFeature, FSK? stateKey = null);
method @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey<FS>> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.FeaturesetFeature<FS> featuresetFeature);
method @com.mapbox.maps.MapboxDelicateApi @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey<FS>> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.TypedFeaturesetDescriptor<FS,?> descriptor, com.mapbox.maps.FeaturesetFeatureId id, FSK? stateKey = null, com.mapbox.maps.FeatureStateOperationCallback callback = FeatureStateOperationCallback({ var it: com.mapbox.bindgen.Expected<java.lang.String,com.mapbox.bindgen.None> ->


}));
method @com.mapbox.maps.MapboxDelicateApi @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.TypedFeaturesetDescriptor<FS,?> descriptor, com.mapbox.maps.FeaturesetFeatureId id, FSK? stateKey = null);
method @com.mapbox.maps.MapboxDelicateApi @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.TypedFeaturesetDescriptor<FS,?> descriptor, com.mapbox.maps.FeaturesetFeatureId id);
method @com.mapbox.maps.MapboxDelicateApi @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey<FS>> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.TypedFeaturesetDescriptor<FS,?> descriptor, com.mapbox.maps.FeaturesetFeatureId id, FSK? stateKey = null);
method @com.mapbox.maps.MapboxDelicateApi @com.mapbox.maps.MapboxExperimental public <FS extends com.mapbox.maps.interactions.FeatureState, FSK extends com.mapbox.maps.interactions.FeatureStateKey<FS>> com.mapbox.common.Cancelable removeFeatureState(com.mapbox.maps.interactions.TypedFeaturesetDescriptor<FS,?> descriptor, com.mapbox.maps.FeaturesetFeatureId id);
method @Deprecated public void removeOnCameraChangeListener(com.mapbox.maps.plugin.delegates.listeners.OnCameraChangeListener onCameraChangeListener);
method @Deprecated public void removeOnMapIdleListener(com.mapbox.maps.plugin.delegates.listeners.OnMapIdleListener onMapIdleListener);
method @Deprecated public void removeOnMapLoadErrorListener(com.mapbox.maps.plugin.delegates.listeners.OnMapLoadErrorListener onMapLoadErrorListener);
Expand Down
8 changes: 4 additions & 4 deletions sdk/src/main/java/com/mapbox/maps/MapboxMap.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2541,11 +2541,11 @@ class MapboxMap :
*/
@MapboxExperimental
@JvmOverloads
fun <FS : FeatureState, FSK : FeatureStateKey> removeFeatureState(
fun <FS, FSK> removeFeatureState(
featuresetFeature: FeaturesetFeature<FS>,
stateKey: FSK? = null,
callback: FeatureStateOperationCallback = FeatureStateOperationCallback { }
): Cancelable {
): Cancelable where FS : FeatureState, FSK : FeatureStateKey<FS> {
checkNativeMap("removeFeatureState")
return featuresetFeature.id?.let { id ->
nativeMap.removeFeatureState(
Expand Down Expand Up @@ -2582,12 +2582,12 @@ class MapboxMap :
@MapboxExperimental
@MapboxDelicateApi
@JvmOverloads
fun <FS : FeatureState, FSK : FeatureStateKey> removeFeatureState(
fun <FS, FSK> removeFeatureState(
descriptor: TypedFeaturesetDescriptor<FS, *>,
id: FeaturesetFeatureId,
stateKey: FSK? = null,
callback: FeatureStateOperationCallback = FeatureStateOperationCallback { },
): Cancelable {
): Cancelable where FS : FeatureState, FSK : FeatureStateKey<FS> {
checkNativeMap("removeFeatureState")
return nativeMap.removeFeatureState(
descriptor.toFeaturesetDescriptor(),
Expand Down

0 comments on commit c8bce8b

Please sign in to comment.