package com.airlock.iam.servicecontainer.app.infrastructure.event.azure;

import com.airlock.iam.servicecontainer.app.domain.service.event.EventHubBatch;
import com.airlock.iam.servicecontainer.app.domain.service.event.EventHubData;
import com.azure.messaging.eventhubs.EventDataBatch;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public final class AzureEventHubBatch implements EventHubBatch {
   private final EventDataBatch batch;

   @Override
   public boolean tryAdd(EventHubData data) {
      return this.batch.tryAdd(((AzureEventHubData)data).getData());
   }

   @Override
   public int getCount() {
      return this.batch.getCount();
   }

   @Override
   public int getMaxSizeInBytes() {
      return this.batch.getMaxSizeInBytes();
   }

   @SuppressFBWarnings(justification = "generated code")
   public AzureEventHubBatch(EventDataBatch batch) {
      this.batch = batch;
   }

   @SuppressFBWarnings(justification = "generated code")
   public EventDataBatch getBatch() {
      return this.batch;
   }
}
