Class ThingModelUtils

java.lang.Object
io.github.webbasedwodt.common.ThingModelUtils

public final class ThingModelUtils extends Object
Utility class for Thing-related operations
  • Constructor Details

    • ThingModelUtils

      public ThingModelUtils(org.eclipse.ditto.things.model.Thing thing)
      Default constructor.
      Parameters:
      thing - the thing to handle
  • Method Details

    • convertStringToType

      public static Object convertStringToType(String input)
      Convert a string to its corresponding type.
      Parameters:
      input - the input to convert
      Returns:
      the result object
    • extractSubPropertiesNames

      public static List<String> extractSubPropertiesNames(String jsonProperty)
      Extract the names of the sub-properties of a JSON property.
      Parameters:
      jsonProperty - the property to handle
      Returns:
      the names of the sub-properties
    • extractSubPropertyValue

      public static String extractSubPropertyValue(String jsonValue, String key)
      Extract the value of a sub-property of a JSON property.
      Parameters:
      jsonValue - the root property from which extract sub-property value
      key - the key of the sub-property
      Returns:
      the sub-property value
    • getDigitalTwinType

      public Optional<String> getDigitalTwinType()
      Get the Digital Twin type.
      Returns:
      an option with the digital twin type
    • getTMContextExtensions

      public List<ThingModelElement> getTMContextExtensions()
      Get the underlying thing model context extensions.
      Returns:
      the list of context extensions
    • getTMProperties

      public List<ThingModelElement> getTMProperties()
      Get the thing model properties.
      Returns:
      the list of properties.
    • getTMActions

      public List<ThingModelElement> getTMActions()
      Get the thing model actions.
      Returns:
      the list of actions.
    • getTMEvents

      public List<ThingModelElement> getTMEvents()
      Get the thing model events.
      Returns:
      the list of events.