Package com.azure.core.util.serializer
Class JsonSerializerProviders
- java.lang.Object
-
- com.azure.core.util.serializer.JsonSerializerProviders
-
public final class JsonSerializerProviders extends Object
This class is a proxy for using aJsonSerializerProvider
loaded from the classpath.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JsonSerializer
createInstance()
Creates an instance ofJsonSerializer
using the firstJsonSerializerProvider
found in the classpath.static JsonSerializer
createInstance(boolean useDefaultIfAbsent)
Creates an instance ofJsonSerializer
using the firstJsonSerializerProvider
found in the classpath.
-
-
-
Method Detail
-
createInstance
public static JsonSerializer createInstance()
Creates an instance ofJsonSerializer
using the firstJsonSerializerProvider
found in the classpath.- Returns:
- A new instance of
JsonSerializer
. - Throws:
IllegalStateException
- if aJsonSerializerProvider
is not found in the classpath.
-
createInstance
public static JsonSerializer createInstance(boolean useDefaultIfAbsent)
Creates an instance ofJsonSerializer
using the firstJsonSerializerProvider
found in the classpath. If no provider is found in classpath, a default provider will be included ifuseDefaultIfAbsent
is set to true.- Parameters:
useDefaultIfAbsent
- If no provider is found in classpath, a default provider will be used. ifuseDefaultIfAbsent
is set to true.- Returns:
- A new instance of
JsonSerializer
. - Throws:
IllegalStateException
- if aJsonSerializerProvider
is not found in the classpath anduseDefaultIfAbsent
is set to false.
-
-