map.put("accuracy", gl.getAccuracy()); map.put("physical_address", gl.getPhysicalAddress()); map.put("internet_address", gl.getInternetAddress()); map.put("formatted_address", gl.getFormattedAddress()); map.put("location_timestamp", writeDateTime(gl.getLocationTimestamp()));
protected void writeGeolocationData(Geolocation geolocation, final JsonObject object) { if (geolocation != null) { final JsonObject other = new JsonObject(); writeCellId(geolocation.getCellId(), other); writeLocationAreaCode(geolocation.getLocationAreaCode(), other); writeMobileCountryCode(geolocation.getMobileCountryCode(), other); writeMobileNetworkCode(geolocation.getMobileNetworkCode(), other); writeNetworkEntityAddress(geolocation.getNetworkEntityAddress(), other); writeAgeOfLocationInfo(geolocation.getAgeOfLocationInfo(), other); writeDeviceLatitude(geolocation.getDeviceLatitude(), other); writeDeviceLongitude(geolocation.getDeviceLongitude(), other); writeAccuracy(geolocation.getAccuracy(), other); writeInternetAddress(geolocation.getInternetAddress(), other); writePhysicalAddress(geolocation.getPhysicalAddress(), other); writeFormattedAddress(geolocation.getFormattedAddress(), other); writeLocationTimestamp(geolocation.getLocationTimestamp(), other); writeEventGeofenceLatitude(geolocation.getEventGeofenceLatitude(), other); writeEventGeofenceLongitude(geolocation.getEventGeofenceLongitude(), other); writeRadius(geolocation.getRadius(), other); object.add("geolocation_data", other); } else { object.add("geolocation_data", JsonNull.INSTANCE); } }
protected void writeGeolocationData(Geolocation geolocation, final HierarchicalStreamWriter writer) { writer.startNode("GeolocationData"); if (geolocation != null) { writeCellId(geolocation.getCellId(), writer); writeLocationAreaCode(geolocation.getLocationAreaCode(), writer); writeMobileCountryCode(geolocation.getMobileCountryCode(), writer); writeMobileNetworkCode(geolocation.getMobileNetworkCode(), writer); writeNetworkEntityAddress(geolocation.getNetworkEntityAddress(), writer); writeAgeOfLocationInfo(geolocation.getAgeOfLocationInfo(), writer); writeDeviceLatitude(geolocation.getDeviceLatitude(), writer); writeDeviceLongitude(geolocation.getDeviceLongitude(), writer); writeAccuracy(geolocation.getAccuracy(), writer); writeInternetAddress(geolocation.getInternetAddress(), writer); writePhysicalAddress(geolocation.getPhysicalAddress(), writer); writeFormattedAddress(geolocation.getFormattedAddress(), writer); writeLocationTimestamp(geolocation.getLocationTimestamp(), writer); writeEventGeofenceLatitude(geolocation.getEventGeofenceLatitude(), writer); writeEventGeofenceLongitude(geolocation.getEventGeofenceLongitude(), writer); writeRadius(geolocation.getRadius(), writer); } writer.endNode(); }