|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.cumulocity.model.util.ExtensibilityConverter
public class ExtensibilityConverter
Converts between Java types and JSON according to the extensibility naming rules.
Nested Class Summary | |
---|---|
protected static class |
ExtensibilityConverter.ClassFinder
|
Constructor Summary | |
---|---|
ExtensibilityConverter()
|
Method Summary | ||
---|---|---|
static Class |
classFromExtensibilityString(String name)
Converts the given name into a class using the extensibility rules where underscores are converted to dots ("_" => "."). |
|
Class |
classFromExtensibilityString2(String name)
|
|
static
|
classToStringRepresentation(Class<T> clazz)
Returns a string representation of the canonical name of the given class but with dots (".") replaced with underscores ("_"). |
|
|
classToStringRepresentation2(Class<T> clazz)
|
|
static Enum |
enumFromExtensibilityString(String name)
Converts the given name into an enum using the extensibility rules where underscores are converted to dots ("_" => "."). |
|
Enum |
enumFromExtensibilityString2(String name)
|
|
static String |
extensibleEnumToStringRepresentation(ExtensibleEnum e)
Returns a string representation of the given extensible enum but with dots (".") in the class name replaced with underscores ("_"). |
|
String |
extensibleEnumToStringRepresentation2(ExtensibleEnum e)
|
|
protected static ExtensibilityConverter |
getInstance()
|
|
protected void |
setClassFinder(ExtensibilityConverter.ClassFinder classFinder)
|
|
protected static void |
setInstance(ExtensibilityConverter instance)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExtensibilityConverter()
Method Detail |
---|
protected void setClassFinder(ExtensibilityConverter.ClassFinder classFinder)
protected static void setInstance(ExtensibilityConverter instance)
protected static ExtensibilityConverter getInstance()
public static Class classFromExtensibilityString(String name) throws ClassNotFoundException
ClassNotFoundException
- if the name cannot be converted to a class using the extensibility rulespublic Class classFromExtensibilityString2(String name) throws ClassNotFoundException
ClassNotFoundException
public static <T> String classToStringRepresentation(Class<T> clazz)
public <T> String classToStringRepresentation2(Class<T> clazz)
public static Enum enumFromExtensibilityString(String name) throws ClassNotFoundException, IllegalArgumentException
ClassNotFoundException
- if the enum class cannot be found
IllegalArgumentException
- if the value does not exist in the enumpublic Enum enumFromExtensibilityString2(String name) throws ClassNotFoundException, IllegalArgumentException
ClassNotFoundException
IllegalArgumentException
public static String extensibleEnumToStringRepresentation(ExtensibleEnum e)
public String extensibleEnumToStringRepresentation2(ExtensibleEnum e)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |