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

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

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

origin: apollographql/apollo-android

 @Override public int weigh(String key, Record value) {
  return key.getBytes(Charset.defaultCharset()).length + value.sizeEstimateBytes();
 }
});
origin: apollographql/apollo-android

 @Test
 public void testRecordWeigher() {
  Record.Builder recordBuilder = Record.builder("root");
  BigDecimal expectedBigDecimal = new BigDecimal(1.23);
  String expectedStringValue = "StringValue";
  Boolean expectedBooleanValue = true;
  CacheReference expectedCacheReference = new CacheReference("foo");
  List<CacheReference> expectedCacheReferenceList = Arrays.asList(new CacheReference("bar"), new CacheReference
    ("baz"));
  List<Object> expectedScalarList = Arrays.<Object>asList("scalarOne", "scalarTwo");

  recordBuilder.addField("bigDecimal", expectedBigDecimal);
  recordBuilder.addField("string", expectedStringValue);
  recordBuilder.addField("boolean", expectedBooleanValue);
  recordBuilder.addField("cacheReference", expectedCacheReference);
  recordBuilder.addField("scalarList", expectedScalarList);
  recordBuilder.addField("referenceList", expectedCacheReferenceList);
  Record record = recordBuilder.build();
  record.sizeEstimateBytes();

  //It's difficult to say what the "right" size estimate is, so just checking it is has been calculate at all.
  assertThat(record.sizeEstimateBytes()).isNotEqualTo(-1);
 }
}
origin: com.amazonaws/aws-android-sdk-appsync-runtime

 @Override public int weigh(String key, Record value) {
  return key.getBytes().length + value.sizeEstimateBytes();
 }
});
origin: awslabs/aws-mobile-appsync-sdk-android

 @Override public int weigh(String key, Record value) {
  return key.getBytes().length + value.sizeEstimateBytes();
 }
});
com.apollographql.apollo.cache.normalizedRecordsizeEstimateBytes

Popular methods of Record

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

Popular in Java

  • Reactive rest calls using spring rest template
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • findViewById (Activity)
  • onRequestPermissionsResult (Fragment)
  • Menu (java.awt)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • CodeWhisperer alternatives
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