class BboxAdapter implements JsonSerializer<Bbox>, JsonDeserializer<Bbox> {

	@Override
	public JsonElement serialize(Bbox src, Type typeOfSrc, JsonSerializationContext context) {
		JsonArray bboxArray = new JsonArray();

		Envelope envelope = src.makeEnvelope();
		if (envelope != null) {
			JsonPrimitive minx = new JsonPrimitive(envelope.getMinX());
			JsonPrimitive miny = new JsonPrimitive(envelope.getMinY());
			JsonPrimitive maxx = new JsonPrimitive(envelope.getMaxX());
			JsonPrimitive maxy = new JsonPrimitive(envelope.getMaxY());
			bboxArray.add(minx);
			bboxArray.add(miny);
			bboxArray.add(maxx);
			bboxArray.add(maxy);
		}
		return bboxArray;
	}

}