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 aJsonSerializerProviderloaded from the classpath.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JsonSerializercreateInstance()Creates an instance ofJsonSerializerusing the firstJsonSerializerProviderfound in the classpath.static JsonSerializercreateInstance(boolean useDefaultIfAbsent)Creates an instance ofJsonSerializerusing the firstJsonSerializerProviderfound in the classpath.
-
-
-
Method Detail
-
createInstance
public static JsonSerializer createInstance()
Creates an instance ofJsonSerializerusing the firstJsonSerializerProviderfound in the classpath.- Returns:
- A new instance of
JsonSerializer. - Throws:
IllegalStateException- if aJsonSerializerProvideris not found in the classpath.
-
createInstance
public static JsonSerializer createInstance(boolean useDefaultIfAbsent)
Creates an instance ofJsonSerializerusing the firstJsonSerializerProviderfound in the classpath. If no provider is found in classpath, a default provider will be included ifuseDefaultIfAbsentis set to true.- Parameters:
useDefaultIfAbsent- If no provider is found in classpath, a default provider will be used. ifuseDefaultIfAbsentis set to true.- Returns:
- A new instance of
JsonSerializer. - Throws:
IllegalStateException- if aJsonSerializerProvideris not found in the classpath anduseDefaultIfAbsentis set to false.
-
-