@Test public void fromJson_coordinatesPresent() throws Exception { thrown.expect(NullPointerException.class); MultiPoint.fromJson("{\"type\":\"MultiPoint\",\"coordinates\":null}"); }
public static MultiPoint fromJson(@NonNull String json) { GsonBuilder gson = new GsonBuilder(); gson.registerTypeAdapterFactory(GeoJsonAdapterFactory.create()); return gson.create().fromJson(json, MultiPoint.class); }
MultiPoint implements CoordinateContainer<List<Point>> { public static MultiPoint fromJson(@NonNull String json) { GsonBuilder gson = new GsonBuilder(); gson.registerTypeAdapterFactory(GeoJsonAdapterFactory.create()); return gson.create().fromJson(json, MultiPoint.class); } }
MultiPoint implements CoordinateContainer<List<Point>> { public static MultiPoint fromJson(@NonNull String json) { GsonBuilder gson = new GsonBuilder(); gson.registerTypeAdapterFactory(GeoJsonAdapterFactory.create()); return gson.create().fromJson(json, MultiPoint.class); } MultiPoint(String type, @Nullable BoundingBox bbox, List<Point> coordinates); }
MultiPoint implements CoordinateContainer<List<Point>> { public static MultiPoint fromJson(@NonNull String json) { GsonBuilder gson = new GsonBuilder(); gson.registerTypeAdapterFactory(GeoJsonAdapterFactory.create()); return gson.create().fromJson(json, MultiPoint.class); } MultiPoint(String type, @Nullable BoundingBox bbox, List<Point> coordinates); static MultiPoint fromJson(@NonNull String json); static MultiPoint fromLngLats(@NonNull List<Point> points); static MultiPoint fromLngLats(@NonNull List<Point> points, @Nullable BoundingBox bbox); @NonNull @Override String type(); @Nullable @Override BoundingBox bbox(); @NonNull @Override List<Point> coordinates(); @Override String toJson(); static TypeAdapter<MultiPoint> typeAdapter(Gson gson); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); }
MultiPoint implements CoordinateContainer<List<Point>> { public static MultiPoint fromJson(@NonNull String json) { GsonBuilder gson = new GsonBuilder(); gson.registerTypeAdapterFactory(GeoJsonAdapterFactory.create()); return gson.create().fromJson(json, MultiPoint.class); } MultiPoint(String type, @Nullable BoundingBox bbox, List<Point> coordinates); static MultiPoint fromJson(@NonNull String json); static MultiPoint fromLngLats(@NonNull List<Point> points); static MultiPoint fromLngLats(@NonNull List<Point> points, @Nullable BoundingBox bbox); @NonNull @Override String type(); @Nullable @Override BoundingBox bbox(); @NonNull @Override List<Point> coordinates(); @Override String toJson(); static TypeAdapter<MultiPoint> typeAdapter(Gson gson); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }