public class XorTypeAdapterFactory
extends java.lang.Object
implements com.google.gson.TypeAdapterFactory
Modifier and Type | Field and Description |
---|---|
private static java.util.regex.Pattern |
FN_UNAVAILABLE |
private static java.util.regex.Pattern |
MODULE_NOT_SUPPORTED |
Constructor and Description |
---|
XorTypeAdapterFactory() |
Modifier and Type | Method and Description |
---|---|
<A> com.google.gson.TypeAdapter<A> |
create(com.google.gson.Gson gson,
com.google.gson.reflect.TypeToken<A> typeToken) |
private <R> com.google.gson.TypeAdapter<Xor<SaltError,R>> |
errorAdapter(com.google.gson.TypeAdapter<R> innerAdapter)
Creates a Xor adapter specifically for the case in which the left side is a
SaltError.
|
private <L,R> com.google.gson.TypeAdapter<Xor<L,R>> |
xorAdapter(com.google.gson.TypeAdapter<L> leftAdapter,
com.google.gson.TypeAdapter<R> rightAdapter)
Creates a generic Xor adapter by combining two other adapters - one for each side of
the Xor type.
|
private static final java.util.regex.Pattern FN_UNAVAILABLE
private static final java.util.regex.Pattern MODULE_NOT_SUPPORTED
public <A> com.google.gson.TypeAdapter<A> create(com.google.gson.Gson gson, com.google.gson.reflect.TypeToken<A> typeToken)
create
in interface com.google.gson.TypeAdapterFactory
private <L,R> com.google.gson.TypeAdapter<Xor<L,R>> xorAdapter(com.google.gson.TypeAdapter<L> leftAdapter, com.google.gson.TypeAdapter<R> rightAdapter)
L
- the generic type for the left side of the XorR
- the generic type for the right side of the XorleftAdapter
- the left adapterrightAdapter
- the right adapterprivate <R> com.google.gson.TypeAdapter<Xor<SaltError,R>> errorAdapter(com.google.gson.TypeAdapter<R> innerAdapter)
R
- the generic type for the right side of the XorinnerAdapter
- the inner adapter