Tabnine Logo
Record.field
Code IndexAdd Tabnine to your IDE (free)

How to use
field
method
in
com.apollographql.apollo.cache.normalized.Record

Best Java code snippets using com.apollographql.apollo.cache.normalized.Record.field (Showing top 5 results out of 315)

origin: apollographql/apollo-android

 @SuppressWarnings({"unchecked", "TypeParameterUnusedInFormals"})
 private <T> T fieldValue(Record record, ResponseField field) {
  String fieldKey = cacheKeyBuilder.build(field, variables);
  if (!record.hasField(fieldKey)) {
   throw new NullPointerException("Missing value: " + field.fieldName());
  }
  return (T) record.field(fieldKey);
 }
}
origin: apollographql/apollo-android

private void assertTestRecordPresentAndAccurate(Record testRecord, NormalizedCache store) {
 final Record cacheRecord1 = store.loadRecord(testRecord.key(), CacheHeaders.NONE);
 assertThat(cacheRecord1.key()).isEqualTo(testRecord.key());
 assertThat(cacheRecord1.field("a")).isEqualTo(testRecord.field("a"));
 assertThat(cacheRecord1.field("b")).isEqualTo(testRecord.field("b"));
}
origin: apollographql/apollo-android

@Test
public void testDualCacheSingleRecord() {
 LruNormalizedCacheFactory secondaryCacheFactory = new LruNormalizedCacheFactory(EvictionPolicy.NO_EVICTION);
 NormalizedCache primaryCache = new LruNormalizedCacheFactory(EvictionPolicy.NO_EVICTION)
   .chain(secondaryCacheFactory).createChain(basicFieldAdapter);
 Record.Builder recordBuilder = Record.builder("root");
 recordBuilder.addField("bar", "bar");
 final Record record = recordBuilder.build();
 primaryCache.merge(record, CacheHeaders.NONE);
 //verify write through behavior
 assertThat(primaryCache.loadRecord("root",
   CacheHeaders.NONE).field("bar")).isEqualTo("bar");
 assertThat(primaryCache.nextCache().get().loadRecord("root",
   CacheHeaders.NONE).field("bar")).isEqualTo("bar");
}
origin: awslabs/aws-mobile-appsync-sdk-android

 @SuppressWarnings("unchecked") private <T> T fieldValue(Record record, ResponseField field) {
  String fieldKey = field.cacheKey(variables);
  if (!record.hasField(fieldKey)) {
   throw new NullPointerException("Missing value: " + field.fieldName());
  }
  return (T) record.field(fieldKey);
 }
}
origin: com.amazonaws/aws-android-sdk-appsync-runtime

 @SuppressWarnings("unchecked") private <T> T fieldValue(Record record, ResponseField field) {
  String fieldKey = field.cacheKey(variables);
  if (!record.hasField(fieldKey)) {
   throw new NullPointerException("Missing value: " + field.fieldName());
  }
  return (T) record.field(fieldKey);
 }
}
com.apollographql.apollo.cache.normalizedRecordfield

Popular methods of Record

  • builder
  • fields
  • key
  • mergeWith
  • sizeEstimateBytes
  • <init>
  • adjustSizeEstimate
  • clone
  • hasField
  • mutationId
  • toBuilder
  • findCacheReferences
  • toBuilder,
  • findCacheReferences,
  • keys,
  • referencedFields

Popular in Java

  • Creating JSON documents from java classes using gson
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • getSupportFragmentManager (FragmentActivity)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Permission (java.security)
    Legacy security code; do not use.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now