Search in sources :

Example 6 with CustomTypeAdapter

use of com.apollographql.apollo.response.CustomTypeAdapter in project apollo-android by apollographql.

the class RealResponseWriter method writeCustom.

@SuppressWarnings("unchecked")
@Override
public void writeCustom(@Nonnull ResponseField.CustomTypeField field, @Nullable Object value) {
    CustomTypeAdapter typeAdapter = scalarTypeAdapters.adapterFor(field.scalarType());
    writeScalarFieldValue(field, value != null ? typeAdapter.encode(value).value : null);
}
Also used : CustomTypeAdapter(com.apollographql.apollo.response.CustomTypeAdapter)

Aggregations

CustomTypeAdapter (com.apollographql.apollo.response.CustomTypeAdapter)6 ScalarType (com.apollographql.apollo.api.ScalarType)3 CustomTypeValue (com.apollographql.apollo.response.CustomTypeValue)3 ScalarTypeAdapters (com.apollographql.apollo.response.ScalarTypeAdapters)3 Logger (com.apollographql.apollo.Logger)2 ApolloLogger (com.apollographql.apollo.internal.ApolloLogger)2 Predicate (com.google.common.base.Predicate)2 ParseException (java.text.ParseException)2 Nullable (javax.annotation.Nullable)2 Request (okhttp3.Request)2 Test (org.junit.Test)2 HttpCache (com.apollographql.apollo.api.cache.http.HttpCache)1 ApolloHttpCache (com.apollographql.apollo.cache.http.ApolloHttpCache)1 DiskLruHttpCacheStore (com.apollographql.apollo.cache.http.DiskLruHttpCacheStore)1 MapFieldValueResolver (com.apollographql.apollo.internal.field.MapFieldValueResolver)1 RealResponseReader (com.apollographql.apollo.internal.response.RealResponseReader)1 File (java.io.File)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Dispatcher (okhttp3.Dispatcher)1