@Override
	public Measurement deserialize(JsonElement json, Type typeOfT,
			JsonDeserializationContext context) throws JsonParseException {

		// get all json elements in order to deserialize them separately
		JsonObject obj = json.getAsJsonObject();
		JsonElement json_timestamp = obj.get("timestamp");
		JsonElement json_wifi = obj.get("wifiReadings");
		JsonElement json_gsm = obj.get("gsmReadings");
		JsonElement json_bluetooth = obj.get("bluetoothReadings");
		
		// init vectors
		Vector<WiFiReading> wifi = new Vector<WiFiReading>();
		Vector<GSMReading> gsm = new Vector<GSMReading>();
		Vector<BluetoothReading> bluetooth = new Vector<BluetoothReading>();		
		
		
		// deserialize reading vectors
		Type listType;
		if(json_wifi != null) {
			listType = new TypeToken<Vector<WiFiReading>>() {}.getType();
			Collection<WiFiReading> wificol = context.deserialize(json_wifi, listType);
			wifi.addAll(wificol);
		}
		
		if(json_gsm != null) {
			listType = new TypeToken<Vector<GSMReading>>() {}.getType();
			Collection<GSMReading> gsmcol = context.deserialize(json_gsm, listType);
			gsm.addAll(gsmcol);
		}
		
		if(json_bluetooth != null) {
			listType = new TypeToken<Vector<BluetoothReading>>() {}.getType();
			Collection<BluetoothReading> bluetoothcol = context.deserialize(json_bluetooth, listType);
			bluetooth.addAll(bluetoothcol);
		}
		// create deserialized measurement
		Measurement m = new Measurement(gsm,wifi,bluetooth);
		if(json_timestamp != null) {
			m.setTimestamp( (Long) context.deserialize(json_timestamp, Long.class) );
		}

		return m;
	}