Example usage for com.google.gson JsonNull INSTANCE

List of usage examples for com.google.gson JsonNull INSTANCE

Introduction

In this page you can find the example usage for com.google.gson JsonNull INSTANCE.

Prototype

JsonNull INSTANCE

To view the source code for com.google.gson JsonNull INSTANCE.

Click Source Link

Document

singleton for JsonNull

Usage

From source file:org.restcomm.connect.http.converter.GeolocationConverter.java

License:Open Source License

protected void writeResponseStatus(final String responseStatus, final JsonObject object) {
    if (responseStatus != null) {
        object.addProperty("response_status", responseStatus);
    } else {/*w w w.  j av a  2s.c o m*/
        object.add("response_status", JsonNull.INSTANCE);
    }
}

From source file:org.restcomm.connect.http.converter.GeolocationConverter.java

License:Open Source License

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 {/*from w w  w  . ja v  a  2  s.c om*/
        object.add("geolocation_data", JsonNull.INSTANCE);
    }
}

From source file:org.restcomm.connect.http.converter.GeolocationConverter.java

License:Open Source License

protected void writeCellId(final String cellId, final JsonObject object) {
    if (cellId != null) {
        object.addProperty("cell_id", cellId);
    } else {/*from  www  . j  ava  2  s  .c  om*/
        object.add("cell_id", JsonNull.INSTANCE);
    }
}

From source file:org.restcomm.connect.http.converter.GeolocationConverter.java

License:Open Source License

protected void writeLocationAreaCode(final String locationAreaCode, final JsonObject object) {
    if (locationAreaCode != null) {
        object.addProperty("location_area_code", locationAreaCode);
    } else {/* w  w w.j a  v a 2s .  c o m*/
        object.add("location_area_code", JsonNull.INSTANCE);
    }
}

From source file:org.restcomm.connect.http.converter.GeolocationConverter.java

License:Open Source License

protected void writeMobileCountryCode(final Integer mobileCountryCode, final JsonObject object) {
    if (mobileCountryCode != null) {
        object.addProperty("mobile_country_code", mobileCountryCode);
    } else {//  ww  w. j  a va  2 s  .  c  om
        object.add("mobile_country_code", JsonNull.INSTANCE);
    }
}

From source file:org.restcomm.connect.http.converter.GeolocationConverter.java

License:Open Source License

protected void writeMobileNetworkCode(final String mobileNetworkCode, final JsonObject object) {
    if (mobileNetworkCode != null) {
        object.addProperty("mobile_network_code", mobileNetworkCode);
    } else {/*  w  ww . j a  v  a 2 s  .  c  om*/
        object.add("mobile_network_code", JsonNull.INSTANCE);
    }
}

From source file:org.restcomm.connect.http.converter.GeolocationConverter.java

License:Open Source License

protected void writeNetworkEntityAddress(final Long networkEntityAddress, final JsonObject object) {
    if (networkEntityAddress != null) {
        object.addProperty("network_entity_address", networkEntityAddress);
    } else {/*from  ww  w.j  a v a2  s . co m*/
        object.add("network_entity_address", JsonNull.INSTANCE);
    }
}

From source file:org.restcomm.connect.http.converter.GeolocationConverter.java

License:Open Source License

protected void writeAgeOfLocationInfo(final Integer ageOfLocationInfo, final JsonObject object) {
    if (ageOfLocationInfo != null) {
        object.addProperty("location_age", ageOfLocationInfo);
    } else {//from   w  ww .j  a  v  a 2s  .co m
        object.add("location_age", JsonNull.INSTANCE);
    }
}

From source file:org.restcomm.connect.http.converter.GeolocationConverter.java

License:Open Source License

protected void writeDeviceLatitude(final String deviceLatitude, final JsonObject object) {
    if (deviceLatitude != null) {
        object.addProperty("device_latitude", deviceLatitude);
    } else {/* w ww  .  j a v a2s. c  o m*/
        object.add("device_latitude", JsonNull.INSTANCE);
    }
}

From source file:org.restcomm.connect.http.converter.GeolocationConverter.java

License:Open Source License

protected void writeDeviceLongitude(final String deviceLongitude, final JsonObject object) {
    if (deviceLongitude != null) {
        object.addProperty("device_longitude", deviceLongitude);
    } else {// ww  w  . j  a  va2  s .  c  o m
        object.add("device_longitude", JsonNull.INSTANCE);
    }
}