@Beta public final class CustomMapTypeAdapterFactory extends Object implements com.google.gson.TypeAdapterFactory
MapTypeAdapterFactory. The main feature is additional access to custom TypeAdapters that can be registered
for native JSON types, see JsonToken. This class becomes obsolete once
https://github.com/google/gson/pull/1290 is merged.| Constructor and Description |
|---|
CustomMapTypeAdapterFactory() |
| Modifier and Type | Method and Description |
|---|---|
<T> com.google.gson.TypeAdapter<T> |
create(com.google.gson.Gson gson,
com.google.gson.reflect.TypeToken<T> typeToken) |
void |
registerAdapter(com.google.gson.stream.JsonToken type,
Predicate<Object> ableToWrite,
com.google.gson.TypeAdapter<?> adapter)
Register a custom type adapter for native JSON primitive types.
|
public void registerAdapter(@Nonnull com.google.gson.stream.JsonToken type, @Nonnull Predicate<Object> ableToWrite, @Nonnull com.google.gson.TypeAdapter<?> adapter)
type - The primitive JSON type.ableToWrite - A predicate to check whether a generic object can be used to serialize using provided adapter.adapter - The actual type adapter to be used for the primitive JSON type.Copyright © 2021 SAP SE. All rights reserved.