diff --git a/core/includes/form.inc b/core/includes/form.inc
index c98e9e8..119124d 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -6,6 +6,7 @@
  */
 
 use Drupal\Component\Utility\UrlHelper;
+use Drupal\Core\Batch\Batch;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Render\Element\RenderElement;
 use Drupal\Core\Template\Attribute;
@@ -712,6 +713,11 @@ function template_preprocess_form_element_label(&$variables) {
  */
 function batch_set($batch_definition) {
   if ($batch_definition) {
+
+    if ($batch_definition instanceof Batch) {
+      $batch_definition = $batch_definition->toArray();
+    }
+
     $batch =& batch_get();
 
     // Initialize the batch if needed.
diff --git a/core/lib/Drupal/Core/Batch/Batch.php b/core/lib/Drupal/Core/Batch/Batch.php
new file mode 100644
index 0000000..5584fc2
--- /dev/null
+++ b/core/lib/Drupal/Core/Batch/Batch.php
@@ -0,0 +1,84 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Batch\Batch.
+ */
+
+namespace Drupal\Core\Batch;
+
+/**
+ * Stores a domain object for a batch process.
+ *
+ * This object contains the same information than a batch array.
+ *
+ * @see batch_set()
+ */
+class Batch {
+
+  protected $operations = [];
+
+  /**
+   * Constructs a new Batch instance.
+   *
+   * @param string $title
+   *   The title.
+   */
+  public function __construct($title = '') {
+    $this->setTitle($title);
+  }
+
+  /**
+   * Static constructor for a batch process.
+   *
+   * @param string $title
+   *   The title.
+   *
+   * @return static
+   */
+  public static function create($title = '') {
+    return new static($title);
+  }
+
+  /**
+   * Sets the title.
+   *
+   * @param string $title
+   *   The title.
+   *
+   * @return $this
+   */
+  public function setTitle($title) {
+    $this->title = $title;
+    return $this;
+  }
+
+  /**
+   * Sets the finished callback.
+   *
+   * This callback will be executed if the batch process is done.
+   *
+   * @param string callback
+   *   The callback
+   *
+   * @return $this
+   */
+  public function setFinishCallback($callback) {
+    $this->finished = $callback;
+    return $this;
+  }
+
+  public function addOperation($callback, $arguments = []) {
+    $this->operations[] = [$callback, $arguments];
+  }
+
+  public function toArray() {
+    $array = [];
+    $array['finished'] = $this->finished;
+    $array['title'] = $this->title;
+    $array['operations'] = $this->operations;
+
+    return $array;
+  }
+
+}
