com.ibm.wiotp.sdk.devicemgmt

Class DeviceLocation



  • public class DeviceLocation
    extends Resource
    A bean class which represents the location of a device. When a property is changed, the IBM Watson IoT Platform will be notified.
    • Constructor Detail

      • DeviceLocation

        public DeviceLocation()
    • Method Detail

      • getLatitude

        public double getLatitude()
      • getLongitude

        public double getLongitude()
      • getElevation

        public double getElevation()
      • getMeasuredDateTime

        public Date getMeasuredDateTime()
      • getAccuracy

        public double getAccuracy()
      • toString

        public String toString()
        Return the JSON string of the DeviceLocation object.
        Overrides:
        toString in class Object
      • update

        public int update(com.google.gson.JsonElement fromLocation)
        Updates each of the resources with the new value
        Specified by:
        update in class Resource
        Parameters:
        fromLocation - The location that needs to be updated
        Returns:
        code indicating whether the update is successful or not (200 means success, otherwise unsuccessful)
      • update

        public int update(com.google.gson.JsonElement fromLocation,
                          boolean fireEvent)
        Updates each of the resources with the new value
        Specified by:
        update in class Resource
        Parameters:
        fromLocation - The location that needs to be updated
        fireEvent - - boolean to indicate whether to fire the update event.
        Returns:
        code indicating whether the update is successful or not (200 means success, otherwise unsuccessful)
      • toJsonObject

        public com.google.gson.JsonObject toJsonObject()
        Return the JsonObject representation of the DeviceLocation object.
        Specified by:
        toJsonObject in class Resource
        Returns:
        JsonObject object

Copyright © 2019. All rights reserved.