Skip to content

Commit

Permalink
Make settings optional
Browse files Browse the repository at this point in the history
  • Loading branch information
DzmitryFomchyn committed Nov 21, 2024
1 parent 8ba4bf0 commit e86fa36
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions MapboxSearch/sdk/api/api-metalava.txt
Original file line number Diff line number Diff line change
Expand Up @@ -607,14 +607,16 @@ package com.mapbox.search.analytics {
package com.mapbox.search.details {

@com.mapbox.search.base.ExperimentalMapboxSearchAPI public interface DetailsApi {
method public default static com.mapbox.search.details.DetailsApi create(com.mapbox.search.details.DetailsApiSettings settings);
method public default static com.mapbox.search.details.DetailsApi create(com.mapbox.search.details.DetailsApiSettings settings = DetailsApiSettings());
method public default static final com.mapbox.search.details.DetailsApi create();
method public default com.mapbox.search.common.AsyncOperationTask retrieveDetails(String mapboxId, com.mapbox.search.details.RetrieveDetailsOptions options, com.mapbox.search.SearchResultCallback callback);
method public com.mapbox.search.common.AsyncOperationTask retrieveDetails(String mapboxId, com.mapbox.search.details.RetrieveDetailsOptions options, java.util.concurrent.Executor executor, com.mapbox.search.SearchResultCallback callback);
field public static final com.mapbox.search.details.DetailsApi.Companion Companion;
}

public static final class DetailsApi.Companion {
method public com.mapbox.search.details.DetailsApi create(com.mapbox.search.details.DetailsApiSettings settings);
method public com.mapbox.search.details.DetailsApi create(com.mapbox.search.details.DetailsApiSettings settings = DetailsApiSettings());
method public com.mapbox.search.details.DetailsApi create();
}

@com.mapbox.search.base.ExperimentalMapboxSearchAPI public final class DetailsApiSettings {
Expand Down
3 changes: 3 additions & 0 deletions MapboxSearch/sdk/api/sdk.api
Original file line number Diff line number Diff line change
Expand Up @@ -738,13 +738,16 @@ public final class com/mapbox/search/analytics/events/SearchResultsInfo$Creator

public abstract interface class com/mapbox/search/details/DetailsApi {
public static final field Companion Lcom/mapbox/search/details/DetailsApi$Companion;
public static fun create ()Lcom/mapbox/search/details/DetailsApi;
public static fun create (Lcom/mapbox/search/details/DetailsApiSettings;)Lcom/mapbox/search/details/DetailsApi;
public abstract fun retrieveDetails (Ljava/lang/String;Lcom/mapbox/search/details/RetrieveDetailsOptions;Lcom/mapbox/search/SearchResultCallback;)Lcom/mapbox/search/common/AsyncOperationTask;
public abstract fun retrieveDetails (Ljava/lang/String;Lcom/mapbox/search/details/RetrieveDetailsOptions;Ljava/util/concurrent/Executor;Lcom/mapbox/search/SearchResultCallback;)Lcom/mapbox/search/common/AsyncOperationTask;
}

public final class com/mapbox/search/details/DetailsApi$Companion {
public final fun create ()Lcom/mapbox/search/details/DetailsApi;
public final fun create (Lcom/mapbox/search/details/DetailsApiSettings;)Lcom/mapbox/search/details/DetailsApi;
public static synthetic fun create$default (Lcom/mapbox/search/details/DetailsApi$Companion;Lcom/mapbox/search/details/DetailsApiSettings;ILjava/lang/Object;)Lcom/mapbox/search/details/DetailsApi;
}

public final class com/mapbox/search/details/DetailsApi$DefaultImpls {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public interface DetailsApi {
* @return a new instance instance of the [DetailsApi].
*/
@JvmStatic
public fun create(settings: DetailsApiSettings): DetailsApi {
@JvmOverloads
public fun create(settings: DetailsApiSettings = DetailsApiSettings()): DetailsApi {
val coreEngine = SearchEngineFactory().createCoreEngineByApiType(
apiType = ApiType.SEARCH_BOX,
baseUrl = settings.baseUrl,
Expand Down

0 comments on commit e86fa36

Please sign in to comment.