Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
DzmitryFomchyn committed Jun 21, 2023
1 parent eb5084d commit 345e23c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
*
* @since 5.4.0
*/
public class SingleElementSafeListTypeAdapter<E> extends TypeAdapter<List<E>> {
class SingleElementSafeListTypeAdapter<E> extends TypeAdapter<List<E>> {

/**
* A type adapter factory instance for serialization/deserialization.
*/
public static final TypeAdapterFactory FACTORY = new TypeAdapterFactory() {
static final TypeAdapterFactory FACTORY = new TypeAdapterFactory() {

@Override
public <T> TypeAdapter<T> create(final Gson gson, final TypeToken<T> typeToken) {
Expand All @@ -47,7 +47,7 @@ public <T> TypeAdapter<T> create(final Gson gson, final TypeToken<T> typeToken)

@SuppressWarnings("unchecked")
final TypeAdapter<T> adapter =
(TypeAdapter<T>) new SingleElementSafeListTypeAdapter<>(elementTypeAdapter);
(TypeAdapter<T>) new SingleElementSafeListTypeAdapter<>(elementTypeAdapter);
return adapter;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.SerializedName;
import com.mapbox.api.geocoding.v6.models.V6FeatureType;
import com.mapbox.api.geocoding.v6.models.V6Worldview;
import com.mapbox.core.exceptions.ServicesException;
import com.mapbox.core.utils.TextUtils;
import com.mapbox.geojson.BoundingBox;
Expand Down Expand Up @@ -352,7 +353,7 @@ public Builder types(@NonNull @V6FeatureType.FeatureType String... types) {
* @return this builder for chaining options together
* @see <a href="https://docs.mapbox.com/api/search/geocoding-v6/#worldviews">Worldviews</a>
*/
public abstract Builder worldview(@NonNull String worldview);
public abstract Builder worldview(@V6Worldview.Worldview @NonNull String worldview);

/**
* Build a new {@link V6ForwardGeocodingRequestOptions} object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.SerializedName;
import com.mapbox.api.geocoding.v6.models.V6FeatureType;
import com.mapbox.api.geocoding.v6.models.V6Worldview;
import com.mapbox.core.utils.TextUtils;
import com.mapbox.geojson.GeometryAdapterFactory;
import com.mapbox.geojson.Point;
Expand Down Expand Up @@ -198,7 +199,7 @@ public Builder types(@NonNull @V6FeatureType.FeatureType String... types) {
* @return this builder for chaining options together
* @see <a href="https://docs.mapbox.com/api/search/geocoding-v6/#worldviews">Worldviews</a>
*/
public abstract Builder worldview(@NonNull String worldview);
public abstract Builder worldview(@V6Worldview.Worldview @NonNull String worldview);

/**
* Build a new {@link V6ReverseGeocodingRequestOptions} object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public abstract class V6Properties extends V6Object {
* @return a string describing the type of the feature
*/
@NonNull
@V6FeatureType.FeatureType
@SerializedName("feature_type")
public abstract String featureType();

Expand Down

0 comments on commit 345e23c

Please sign in to comment.