android/sdk/src/main/java/io/o2mc/sdk/business/batch/BatchBus.java
private Batch mergeBatches(List<Batch> batches) {
    if (batches.size() <= 0) return null; // can't merge non existent batches

    List<Event> allEvents = new ArrayList<>();
    for (Batch b : batches) {
      allEvents.addAll(b.getEvents());
    }

    // The batch ID is the same for every batch in the current user session, doesn't matter if we get the 1st one or the last one
    String batchId = batches.get(0).getSessionId();

    return generateBatch(batchId, allEvents);
  }
/**
   * Merges all batches currently in the BatchBus.
   * This removes meta data from old batches, and generates a new batch by only keeping all of the events from old batches.
   * This reduces overhead and thus saves data (by sending less meta data in total).
   *
   * @return a big(ger) Batch containing the events of every batch currently in the BatchBus, null if no batches provided
   */
Merges all batches currently in the BatchBus.
This removes meta data from old batches, and generates a new batch by only keeping all of the events from old batches.
This reduces overhead and thus saves data (by sending less meta data in total).

@return a big(ger) Batch containing the events of every batch currently in the BatchBus, null if no batches provided
Merges all batches currently in the BatchBus . This removes meta data from old batches and generates a new batch by only keeping all of the events from old batches . This reduces overhead and thus saves data ( by sending less meta data in total ) . @return a big ( ger ) Batch containing the events of every batch currently in the BatchBus null if no batches provided
private Batch mergeBatches(List<Batch> batches) {
    if (batches.size() <= 0) return null; 
    List<Event> allEvents = new ArrayList<>();
    for (Batch b : batches) {
      allEvents.addAll(b.getEvents());
    }
    String batchId = batches.get(0).getSessionId();
    return generateBatch(batchId, allEvents);
  }
private Batch mergeBatches ( List < Batch > batches ) { if ( batches . size ( ) <= 0 ) return null ; List < Event > allEvents = new ArrayList < > ( ) ; for ( Batch b : batches ) { allEvents . addAll ( b . getEvents ( ) ) ; } String batchId = batches . get ( 0 ) . getSessionId ( ) ; return generateBatch ( batchId , allEvents ) ; }
Merges all batches currently in the BatchBus.
Merges all batches currently in the BatchBus .
// can't merge non existent batches // The batch ID is the same for every batch in the current user session, doesn't matter if we get the 1st one or the last one