API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Url.php/c...
When you look at the class docs for Url, it hardly tell you anything. Developers reading this should be told that Url objects should be created with one of the static createFromFoo() methods, and it should give a brief list of these.