How to get all values from a new node being created in hook_ENTITY_TYPE_presave() Drupal 8.7.2

function mymodule_node_presave(Drupal\Core\Entity\EntityInterface $entity) {
  data_dump($entity-&gt;original); //is empty because its a new node, not a node being updated.
  // How to get all values at one time?
  // By values I mean the same value you would get from:
  data_dump($entity-&gt;get('title')-&gt;value);
  // but from all fields and not just one field at a time.
}


I have a custom content type that has 30 custom fields that I need to examine inside this hook.  I'd like to avoid getting the value of each field individually.

Thank you for your time.
There are probably a few different ways to get that info, but if the returned format suits your needs then EntityInterface::toArray(), which Gets an array of all property values, is probably the most succinct:

$field_data = $entity-&gt;toArray();