diff --git a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php
index 45033e9..67c6451 100644
--- a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php
+++ b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php
@@ -143,6 +143,51 @@ public function id() {
   /**
    * {@inheritdoc}
    */
+  public function getWeight() {
+    return $this->weight;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getRoles() {
+    return $this->roles;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function isCacheable() {
+    return $this->cache > 0;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setWeight($weight) {
+    $this->set('weight', $weight);
+    return $this;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setRoles($roles) {
+    $this->set('roles', $roles);
+    return $this;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setCache($cache) {
+    $this->set('cache', $cache);
+    return $this;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function filters($instance_id = NULL) {
     if (!isset($this->filterBag)) {
       $this->filterBag = new FilterBag(\Drupal::service('plugin.manager.filter'), $this->filters);
diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatInterface.php b/core/modules/filter/lib/Drupal/filter/FilterFormatInterface.php
index 77fad0c..78d8682 100644
--- a/core/modules/filter/lib/Drupal/filter/FilterFormatInterface.php
+++ b/core/modules/filter/lib/Drupal/filter/FilterFormatInterface.php
@@ -58,4 +58,61 @@ public function isFallbackFormat();
    */
   public function getPermissionName();
 
+  /**
+   * Returns the weight of the format in the text format selector.
+   *
+   * @return int
+   *   The weight of this format.
+   */
+  public function getWeight();
+
+  /**
+   * Returns the list of user role IDS.
+   *
+   * @return array
+   *   The role ID list.
+   */
+  public function getRoles();
+
+  /**
+   * Returns the cache status.
+   *
+   * @return bool
+   *   TRUE if the filter is cached.
+   */
+  public function isCacheable();
+
+  /**
+   * Sets the weight to the given value.
+   *
+   * @param int $weight
+   *   The desired weight.
+   *
+   * @return \Drupal\filter\FilterFormatInterface
+   *   The class instance this method is called on.
+   */
+  public function setWeight($weight);
+
+  /**
+   * Sets the list of user role IDs to the given array.
+   *
+   * @param array $roles
+   *   The desired user role ID array.
+   *
+   * @return \Drupal\filter\FilterFormatInterface
+   *   The class instance this method is called on.
+   */
+  public function setRoles($roles);
+
+  /**
+   * Sets the cache value (whether or not text of this format can be cached).
+   *
+   * @param bool $cache
+   *   The desired cache value.
+   *
+   * @return \Drupal\filter\FilterFormatInterface
+   *   The class instance this method is called on.
+   */
+  public function setCache($cache);
+
 }
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatMethodsTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatMethodsTest.php
new file mode 100644
index 0000000..64d5586
--- /dev/null
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatMethodsTest.php
@@ -0,0 +1,79 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\filter\Tests\FilterFormatMethodsTest.
+ */
+
+namespace Drupal\filter\Tests;
+
+use Drupal\simpletest\DrupalUnitTestBase;
+/**
+ * Tests get and set methods on text format interface.
+ */
+class FilterFormatMethodsTest extends DrupalUnitTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('filter');
+
+  /**
+   * Text format object.
+   *
+   * @var object
+   */
+  private $format;
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Filter format get and set methods',
+      'description' => 'Test get and set methods on text format interface.',
+      'group' => 'Filter',
+    );
+  }
+
+  function setUp() {
+    parent::setUp();
+
+    $this->format = entity_create('filter_format', array());
+    $this->format->format = 'custom_format';
+    $this->format->name = 'Custom format';
+    $this->format->setFilterConfig('filter_url', array(
+      'status' => 1,
+      'settings' => array(
+        'filter_url_length' => 30,
+      ),
+    ));
+    $this->format->save();
+  }
+
+  /**
+   * Tests weight get and set method.
+   */
+  function testGetWeight() {
+    $weight = 0;
+    $this->assertIdentical(spl_object_hash($this->format->setWeight($weight)), spl_object_hash($this->format), format_string('Test weight set method for text format %format.', array('%format' => $this->format->name)));
+    $this->assertIdentical($this->format->getWeight(), $weight, format_string('Test weight get method for text format %format.', array('%format' => $this->format->name)));
+  }
+
+  /**
+   * Tests roles get and set method.
+   */
+  function testGetRoles() {
+    $roles = array(0,1);
+    $this->assertIdentical(spl_object_hash($this->format->setRoles($roles)), spl_object_hash($this->format), format_string('Test roles set method for text format %format.', array('%format' => $this->format->name)));
+    $this->assertIdentical($this->format->getRoles(), $roles, format_string('Test roles get method for text format %format.', array('%format' => $this->format->name)));
+  }
+
+  /**
+   * Tests cache get and set method.
+   */
+  function testIsCacheable() {
+    $is_cacheable = TRUE;
+    $this->assertIdentical(spl_object_hash($this->format->setCache($is_cacheable)), spl_object_hash($this->format), format_string('Test cache set method for text format %format.', array('%format' => $this->format->name)));
+    $this->assertIdentical($this->format->isCacheable(), $is_cacheable, format_string('Test cache get method for text format %format.', array('%format' => $this->format->name)));
+  }
+}
