Represent the resource used by a batch including element and byte. It can also be extended to
other things to determine if adding a new element needs to be flow controlled or if the current
batch needs to be flushed.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis document details the \u003ccode\u003eBatchResource\u003c/code\u003e interface within the Google API Client Library for Java, specifically across versions 2.61.0, with links provided to versions from 2.63.1 down to 2.7.1.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBatchResource\u003c/code\u003e interface is used to manage batch operations, keeping track of element and byte counts, and it allows for extending the interface to control when new elements are added or the batch needs to be flushed.\u003c/p\u003e\n"],["\u003cp\u003eKey methods of the \u003ccode\u003eBatchResource\u003c/code\u003e interface include \u003ccode\u003eadd(BatchResource resource)\u003c/code\u003e for combining resources, \u003ccode\u003egetByteCount()\u003c/code\u003e to retrieve the total bytes, \u003ccode\u003egetElementCount()\u003c/code\u003e to get the total elements, and \u003ccode\u003eshouldFlush(long maxElementThreshold, long maxBytesThreshold)\u003c/code\u003e to check if a batch should be flushed based on specified thresholds.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eadd()\u003c/code\u003e method takes another \u003ccode\u003eBatchResource\u003c/code\u003e as a parameter, returning a new \u003ccode\u003eBatchResource\u003c/code\u003e, while \u003ccode\u003egetByteCount()\u003c/code\u003e and \u003ccode\u003egetElementCount()\u003c/code\u003e both return a long integer value, and \u003ccode\u003eshouldFlush()\u003c/code\u003e returns a boolean value, as detailed within the provided tables.\u003c/p\u003e\n"]]],[],null,[]]