Package com.cumulocity.model.util
Class ExtensibilityConverter
java.lang.Object
com.cumulocity.model.util.ExtensibilityConverter
Converts between Java types and JSON according to the extensibility naming rules.
-
Constructor Summary
ModifierConstructorDescriptionprotected
ExtensibilityConverter
(Duration cacheTimeout, ClassFinder classFinder) -
Method Summary
Modifier and TypeMethodDescriptionstatic Class
Converts the given name into a class using the extensibility rules where underscores ("_") are converted to dots (".").protected Class
static <T> String
classToStringRepresentation
(Class<T> clazz) Returns a string representation of the canonical name of the given class but with dots (".") replaced with underscores ("_").static boolean
isConvertable
(String name)
-
Constructor Details
-
ExtensibilityConverter
-
-
Method Details
-
classFromExtensibilityString
Converts the given name into a class using the extensibility rules where underscores ("_") are converted to dots ("."). For example:
name = "com_cumulocity_model_idtype_Reference" would return the class com.cumulocity.mode.idtype.Reference- Throws:
ClassNotFoundException
- if the name cannot be converted to a class using the extensibility rules
-
isConvertable
-
classFromExtensibilityString2
- Throws:
ClassNotFoundException
-
classToStringRepresentation
Returns a string representation of the canonical name of the given class but with dots (".") replaced with underscores ("_"). Useful for creating JSON property names from class names. -
getFoundClasses
-