Package io.github.webbasedwodt.common
Class ThingModelUtils
java.lang.Object
io.github.webbasedwodt.common.ThingModelUtils
Utility class for Thing-related operations
-
Constructor Summary
ConstructorsConstructorDescriptionThingModelUtils
(org.eclipse.ditto.things.model.Thing thing) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic Object
convertStringToType
(String input) Convert a string to its corresponding type.extractSubPropertiesNames
(String jsonProperty) Extract the names of the sub-properties of a JSON property.static String
extractSubPropertyValue
(String jsonValue, String key) Extract the value of a sub-property of a JSON property.Get the Digital Twin type.Get the thing model actions.Get the underlying thing model context extensions.Get the thing model events.Get the thing model properties.
-
Constructor Details
-
ThingModelUtils
public ThingModelUtils(org.eclipse.ditto.things.model.Thing thing) Default constructor.- Parameters:
thing
- the thing to handle
-
-
Method Details
-
convertStringToType
Convert a string to its corresponding type.- Parameters:
input
- the input to convert- Returns:
- the result object
-
extractSubPropertiesNames
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
Extract the value of a sub-property of a JSON property.- Parameters:
jsonValue
- the root property from which extract sub-property valuekey
- the key of the sub-property- Returns:
- the sub-property value
-
getDigitalTwinType
Get the Digital Twin type.- Returns:
- an option with the digital twin type
-
getTMContextExtensions
Get the underlying thing model context extensions.- Returns:
- the list of context extensions
-
getTMProperties
Get the thing model properties.- Returns:
- the list of properties.
-
getTMActions
Get the thing model actions.- Returns:
- the list of actions.
-
getTMEvents
Get the thing model events.- Returns:
- the list of events.
-