Skip to content

Commit

Permalink
move default method to an abstract class so that we can downgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
“osana” committed Aug 27, 2018
1 parent 56470d3 commit 746b8dd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 29 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -49,8 +49,8 @@ subprojects {
}
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

dependencies {

Expand Down
21 changes: 11 additions & 10 deletions samples/build.gradle
Expand Up @@ -5,19 +5,20 @@ sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

dependencies {
implementation project(":services-geocoding")
implementation project(":services-optimization")
implementation project(":services-geojson")
implementation project(":services-matching")
implementation project(":services-staticmap")
implementation project(":services-speech")
implementation project(":services-geocoding")
implementation project(":services-optimization")
implementation project(":services-geojson")
implementation project(":services-matching")
implementation project(":services-staticmap")
implementation project(":services-speech")
implementation project(":services-tilequery")
}

buildConfig {
packageName = 'com.mapbox.sample'
buildConfigField 'String', 'MAPBOX_ACCESS_TOKEN', System.getenv("MAPBOX_ACCESS_TOKEN")
packageName = 'com.mapbox.sample'
buildConfigField 'String', 'MAPBOX_ACCESS_TOKEN', System.getenv("MAPBOX_ACCESS_TOKEN")
}

sonarqube {
skipProject = true
}
skipProject = true
}
16 changes: 0 additions & 16 deletions services-geojson/src/main/java/com/mapbox/geojson/Geometry.java
Expand Up @@ -15,20 +15,4 @@
*/
public interface Geometry extends GeoJson {

/**
* Create a new instance of this class by passing in a formatted valid JSON String.
*
* @param json a formatted valid JSON string defining a GeoJson Geometry
* @return a new instance of this class defined by the values passed inside this static factory
* method
* @since 3.0.0
*/
static Geometry fromJson(@NonNull String json) {
GsonBuilder gson = new GsonBuilder();
gson.registerTypeAdapterFactory(GeoJsonAdapterFactory.create());
gson.registerTypeAdapter(Point.class, new PointDeserializer());
gson.registerTypeAdapter(Geometry.class, new GeometryDeserializer());
return gson.create().fromJson(json, Geometry.class);
}

}
Expand Up @@ -15,7 +15,7 @@ public class GeometryTest extends TestUtils {
@Test
public void fromJson() throws IOException {
final String json = loadJsonFixture(SAMPLE_GEOMETRY_COLLECTION);
Geometry geo = Geometry.fromJson(json);
Geometry geo = GeometryGeoJson.fromJson(json);
assertEquals(geo.type(), "GeometryCollection");
}
}

0 comments on commit 746b8dd

Please sign in to comment.