TypeAdapters
Date: 2016-11-03

com.google.gson.internal.bind

## Class TypeAdapters

- java.lang.Object
- - com.google.gson.internal.bind.TypeAdapters

-     public final class TypeAdapters
      extends java.lang.Object

  Type adapters for basic types.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static TypeAdapter<java.util.concurrent.atomic.AtomicBoolean>` | `ATOMIC_BOOLEAN`
    `static TypeAdapterFactory` | `ATOMIC_BOOLEAN_FACTORY`
    `static TypeAdapter<java.util.concurrent.atomic.AtomicInteger>` | `ATOMIC_INTEGER`
    `static TypeAdapter<java.util.concurrent.atomic.AtomicIntegerArray>` | `ATOMIC_INTEGER_ARRAY`
    `static TypeAdapterFactory` | `ATOMIC_INTEGER_ARRAY_FACTORY`
    `static TypeAdapterFactory` | `ATOMIC_INTEGER_FACTORY`
    `static TypeAdapter<java.math.BigDecimal>` | `BIG_DECIMAL`
    `static TypeAdapter<java.math.BigInteger>` | `BIG_INTEGER`
    `static TypeAdapter<java.util.BitSet>` | `BIT_SET`
    `static TypeAdapterFactory` | `BIT_SET_FACTORY`
    `static TypeAdapter<java.lang.Boolean>` | `BOOLEAN`
    `static TypeAdapter<java.lang.Boolean>` | `BOOLEAN_AS_STRING` Writes a boolean as a string.
    `static TypeAdapterFactory` | `BOOLEAN_FACTORY`
    `static TypeAdapter<java.lang.Number>` | `BYTE`
    `static TypeAdapterFactory` | `BYTE_FACTORY`
    `static TypeAdapter<java.util.Calendar>` | `CALENDAR`
    `static TypeAdapterFactory` | `CALENDAR_FACTORY`
    `static TypeAdapter<java.lang.Character>` | `CHARACTER`
    `static TypeAdapterFactory` | `CHARACTER_FACTORY`
    `static TypeAdapter<java.lang.Class>` | `CLASS`
    `static TypeAdapterFactory` | `CLASS_FACTORY`
    `static TypeAdapter<java.util.Currency>` | `CURRENCY`
    `static TypeAdapterFactory` | `CURRENCY_FACTORY`
    `static TypeAdapter<java.lang.Number>` | `DOUBLE`
    `static TypeAdapterFactory` | `ENUM_FACTORY`
    `static TypeAdapter<java.lang.Number>` | `FLOAT`
    `static TypeAdapter<java.net.InetAddress>` | `INET_ADDRESS`
    `static TypeAdapterFactory` | `INET_ADDRESS_FACTORY`
    `static TypeAdapter<java.lang.Number>` | `INTEGER`
    `static TypeAdapterFactory` | `INTEGER_FACTORY`
    `static TypeAdapter<JsonElement>` | `JSON_ELEMENT`
    `static TypeAdapterFactory` | `JSON_ELEMENT_FACTORY`
    `static TypeAdapter<java.util.Locale>` | `LOCALE`
    `static TypeAdapterFactory` | `LOCALE_FACTORY`
    `static TypeAdapter<java.lang.Number>` | `LONG`
    `static TypeAdapter<java.lang.Number>` | `NUMBER`
    `static TypeAdapterFactory` | `NUMBER_FACTORY`
    `static TypeAdapter<java.lang.Number>` | `SHORT`
    `static TypeAdapterFactory` | `SHORT_FACTORY`
    `static TypeAdapter<java.lang.String>` | `STRING`
    `static TypeAdapter<java.lang.StringBuffer>` | `STRING_BUFFER`
    `static TypeAdapterFactory` | `STRING_BUFFER_FACTORY`
    `static TypeAdapter<java.lang.StringBuilder>` | `STRING_BUILDER`
    `static TypeAdapterFactory` | `STRING_BUILDER_FACTORY`
    `static TypeAdapterFactory` | `STRING_FACTORY`
    `static TypeAdapterFactory` | `TIMESTAMP_FACTORY`
    `static TypeAdapter<java.net.URI>` | `URI`
    `static TypeAdapterFactory` | `URI_FACTORY`
    `static TypeAdapter<java.net.URL>` | `URL`
    `static TypeAdapterFactory` | `URL_FACTORY`
    `static TypeAdapter<java.util.UUID>` | `UUID`
    `static TypeAdapterFactory` | `UUID_FACTORY`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <TT> TypeAdapterFactory` | `newFactory(java.lang.Class<TT> unboxed, java.lang.Class<TT> boxed, TypeAdapter<? super TT> typeAdapter)`
    `static <TT> TypeAdapterFactory` | `newFactory(java.lang.Class<TT> type, TypeAdapter<TT> typeAdapter)`
    `static <TT> TypeAdapterFactory` | `newFactory(TypeToken<TT> type, TypeAdapter<TT> typeAdapter)`
    `static <TT> TypeAdapterFactory` | `newFactoryForMultipleTypes(java.lang.Class<TT> base, java.lang.Class<? extends TT> sub, TypeAdapter<? super TT> typeAdapter)`
    `static <T1> TypeAdapterFactory` | `newTypeHierarchyFactory(java.lang.Class<T1> clazz, TypeAdapter<T1> typeAdapter)` Returns a factory for all subtypes of `typeAdapter`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### CLASS

          public static final TypeAdapter<java.lang.Class> CLASS

    - #### CLASS_FACTORY

          public static final TypeAdapterFactory CLASS_FACTORY

    - #### BIT_SET

          public static final TypeAdapter<java.util.BitSet> BIT_SET

    - #### BIT_SET_FACTORY

          public static final TypeAdapterFactory BIT_SET_FACTORY

    - #### BOOLEAN

          public static final TypeAdapter<java.lang.Boolean> BOOLEAN

    - #### BOOLEAN_AS_STRING

          public static final TypeAdapter<java.lang.Boolean> BOOLEAN_AS_STRING

      Writes a boolean as a string. Useful for map keys, where booleans aren't otherwise permitted.

    - #### BOOLEAN_FACTORY

          public static final TypeAdapterFactory BOOLEAN_FACTORY

    - #### BYTE

          public static final TypeAdapter<java.lang.Number> BYTE

    - #### BYTE_FACTORY

          public static final TypeAdapterFactory BYTE_FACTORY

    - #### SHORT

          public static final TypeAdapter<java.lang.Number> SHORT

    - #### SHORT_FACTORY

          public static final TypeAdapterFactory SHORT_FACTORY

    - #### INTEGER

          public static final TypeAdapter<java.lang.Number> INTEGER

    - #### INTEGER_FACTORY

          public static final TypeAdapterFactory INTEGER_FACTORY

    - #### ATOMIC_INTEGER

          public static final TypeAdapter<java.util.concurrent.atomic.AtomicInteger> ATOMIC_INTEGER

    - #### ATOMIC_INTEGER_FACTORY

          public static final TypeAdapterFactory ATOMIC_INTEGER_FACTORY

    - #### ATOMIC_BOOLEAN

          public static final TypeAdapter<java.util.concurrent.atomic.AtomicBoolean> ATOMIC_BOOLEAN

    - #### ATOMIC_BOOLEAN_FACTORY

          public static final TypeAdapterFactory ATOMIC_BOOLEAN_FACTORY

    - #### ATOMIC_INTEGER_ARRAY

          public static final TypeAdapter<java.util.concurrent.atomic.AtomicIntegerArray> ATOMIC_INTEGER_ARRAY

    - #### ATOMIC_INTEGER_ARRAY_FACTORY

          public static final TypeAdapterFactory ATOMIC_INTEGER_ARRAY_FACTORY

    - #### LONG

          public static final TypeAdapter<java.lang.Number> LONG

    - #### FLOAT

          public static final TypeAdapter<java.lang.Number> FLOAT

    - #### DOUBLE

          public static final TypeAdapter<java.lang.Number> DOUBLE

    - #### NUMBER

          public static final TypeAdapter<java.lang.Number> NUMBER

    - #### NUMBER_FACTORY

          public static final TypeAdapterFactory NUMBER_FACTORY

    - #### CHARACTER

          public static final TypeAdapter<java.lang.Character> CHARACTER

    - #### CHARACTER_FACTORY

          public static final TypeAdapterFactory CHARACTER_FACTORY

    - #### STRING

          public static final TypeAdapter<java.lang.String> STRING

    - #### BIG_DECIMAL

          public static final TypeAdapter<java.math.BigDecimal> BIG_DECIMAL

    - #### BIG_INTEGER

          public static final TypeAdapter<java.math.BigInteger> BIG_INTEGER

    - #### STRING_FACTORY

          public static final TypeAdapterFactory STRING_FACTORY

    - #### STRING_BUILDER

          public static final TypeAdapter<java.lang.StringBuilder> STRING_BUILDER

    - #### STRING_BUILDER_FACTORY

          public static final TypeAdapterFactory STRING_BUILDER_FACTORY

    - #### STRING_BUFFER

          public static final TypeAdapter<java.lang.StringBuffer> STRING_BUFFER

    - #### STRING_BUFFER_FACTORY

          public static final TypeAdapterFactory STRING_BUFFER_FACTORY

    - #### URL

          public static final TypeAdapter<java.net.URL> URL

    - #### URL_FACTORY

          public static final TypeAdapterFactory URL_FACTORY

    - #### URI

          public static final TypeAdapter<java.net.URI> URI

    - #### URI_FACTORY

          public static final TypeAdapterFactory URI_FACTORY

    - #### INET_ADDRESS

          public static final TypeAdapter<java.net.InetAddress> INET_ADDRESS

    - #### INET_ADDRESS_FACTORY

          public static final TypeAdapterFactory INET_ADDRESS_FACTORY

    - #### UUID

          public static final TypeAdapter<java.util.UUID> UUID

    - #### UUID_FACTORY

          public static final TypeAdapterFactory UUID_FACTORY

    - #### CURRENCY

          public static final TypeAdapter<java.util.Currency> CURRENCY

    - #### CURRENCY_FACTORY

          public static final TypeAdapterFactory CURRENCY_FACTORY

    - #### TIMESTAMP_FACTORY

          public static final TypeAdapterFactory TIMESTAMP_FACTORY

    - #### CALENDAR

          public static final TypeAdapter<java.util.Calendar> CALENDAR

    - #### CALENDAR_FACTORY

          public static final TypeAdapterFactory CALENDAR_FACTORY

    - #### LOCALE

          public static final TypeAdapter<java.util.Locale> LOCALE

    - #### LOCALE_FACTORY

          public static final TypeAdapterFactory LOCALE_FACTORY

    - #### JSON_ELEMENT

          public static final TypeAdapter<JsonElement> JSON_ELEMENT

    - #### JSON_ELEMENT_FACTORY

          public static final TypeAdapterFactory JSON_ELEMENT_FACTORY

    - #### ENUM_FACTORY

          public static final TypeAdapterFactory ENUM_FACTORY

  - ### Method Detail

    - #### newFactory

          public static <TT> TypeAdapterFactory newFactory(TypeToken<TT> type,
                                           TypeAdapter<TT> typeAdapter)

    - #### newFactory

          public static <TT> TypeAdapterFactory newFactory(java.lang.Class<TT> type,
                                           TypeAdapter<TT> typeAdapter)

    - #### newFactory

          public static <TT> TypeAdapterFactory newFactory(java.lang.Class<TT> unboxed,
                                           java.lang.Class<TT> boxed,
                                           TypeAdapter<? super TT> typeAdapter)

    - #### newFactoryForMultipleTypes

          public static <TT> TypeAdapterFactory newFactoryForMultipleTypes(java.lang.Class<TT> base,
                                                           java.lang.Class<? extends TT> sub,
                                                           TypeAdapter<? super TT> typeAdapter)

    - #### newTypeHierarchyFactory

          public static <T1> TypeAdapterFactory newTypeHierarchyFactory(java.lang.Class<T1> clazz,
                                                        TypeAdapter<T1> typeAdapter)

      Returns a factory for all subtypes of `typeAdapter`. We do a runtime check to confirm that the deserialized type matches the type requested.