How do I get the content type of a node entity from the $entity object? I'm using hook_ENTITY_TYPE_presave() to alter the values of nodes upon saving, but I only want to do this for a specific content type.

How do I check the content type of the $entity object?  I looked at the documentation for class node and working with Entity API, but all I found was how to get the entity type, not the content type.

Given a node $entity object, how can I check the content type?
If you know that you have a node, then you can use getType(). If you don't know that, you can use he generic method -&gt;bundle(). Note that the second will return the entity type in case of an entity type that doesn't have bundles, like users.

Again, my standard reference to http://wizzlern.nl/sites/wizzlern.nl/files/artikel/drupal-content-entity-8.0.pdf, it contains both methods.