Class GsonJsonSerializer
java.lang.Object
com.azure.core.serializer.json.gson.GsonJsonSerializer
- All Implemented Interfaces:
JsonSerializer,MemberNameConverter,ObjectSerializer
GSON based implementation of the
JsonSerializer and MemberNameConverter interfaces.-
Method Summary
Modifier and TypeMethodDescriptionconvertMemberName(Member member) Attempts to get the JSON serialized property name from the passedMember.<T> Tdeserialize(InputStream stream, TypeReference<T> typeReference) Reads a JSON stream into its object representation.<T> Mono<T>deserializeAsync(InputStream stream, TypeReference<T> typeReference) Reads a JSON stream into its object representation.voidserialize(OutputStream stream, Object value) Writes an object's JSON representation into a stream.serializeAsync(OutputStream stream, Object value) Writes an object's JSON representation into a stream.Mono<byte[]>serializeToBytesAsync(Object value) Converts the object into a JSON byte array.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.core.util.serializer.JsonSerializer
deserializeFromBytes, deserializeFromBytesAsync, serializeToBytes
-
Method Details
-
deserialize
Description copied from interface:com.azure.core.util.serializer.JsonSerializerReads a JSON stream into its object representation.- Specified by:
deserializein interfaceJsonSerializer- Specified by:
deserializein interfaceObjectSerializer- Type Parameters:
T- Type of the object.- Parameters:
stream- JSON stream.typeReference-TypeReferencerepresenting the object.- Returns:
- The object represented by the deserialized JSON stream.
-
deserializeAsync
Description copied from interface:com.azure.core.util.serializer.JsonSerializerReads a JSON stream into its object representation.- Specified by:
deserializeAsyncin interfaceJsonSerializer- Specified by:
deserializeAsyncin interfaceObjectSerializer- Type Parameters:
T- Type of the object.- Parameters:
stream- JSON stream.typeReference-TypeReferencerepresenting the object.- Returns:
- Reactive stream that emits the object represented by the deserialized JSON stream.
-
serialize
Description copied from interface:com.azure.core.util.serializer.JsonSerializerWrites an object's JSON representation into a stream.- Specified by:
serializein interfaceJsonSerializer- Specified by:
serializein interfaceObjectSerializer- Parameters:
stream-OutputStreamwhere the object's JSON representation will be written.value- The object.
-
serializeToBytesAsync
Description copied from interface:com.azure.core.util.serializer.JsonSerializerConverts the object into a JSON byte array.- Specified by:
serializeToBytesAsyncin interfaceJsonSerializer- Specified by:
serializeToBytesAsyncin interfaceObjectSerializer- Parameters:
value- The object.- Returns:
- Reactive stream that emits the JSON binary representation of the serialized object.
-
serializeAsync
Description copied from interface:com.azure.core.util.serializer.JsonSerializerWrites an object's JSON representation into a stream.- Specified by:
serializeAsyncin interfaceJsonSerializer- Specified by:
serializeAsyncin interfaceObjectSerializer- Parameters:
stream-OutputStreamwhere the object's JSON representation will be written.value- The object.- Returns:
- Reactive stream that will indicate operation completion.
-
convertMemberName
Description copied from interface:com.azure.core.util.serializer.MemberNameConverterAttempts to get the JSON serialized property name from the passedMember.If a
ConstructororExecutableis passednullwill be returned.- Specified by:
convertMemberNamein interfaceMemberNameConverter- Parameters:
member- TheMemberthat will have its JSON serialized property name retrieved.- Returns:
- The JSON property name for the
Member.
-