title: Unwrap an Optional only if it is present
body: <p>So currently I have</p>
  
  <pre><code>String uri = website.getUri();
  Optional&lt;PageDetail&gt; pageDetail = webClient.getDetailOfUri(uri);
  String displayName;
  String description;
  if (pageDetail.isPresent()) {
      displayName = pageDetail.get().getName();
      description = pageDetail.get().getDescription();
  } else {
      displayName = uri;
      description = "";
  }
  </code></pre>
  
  <p>I am calling the <code>getDetailOfUri(uri)</code> method, which returns an <code>Optional&lt;PageDetail&gt;</code>, and I would like to set the strings <code>displayName</code> and <code>description</code> to the values of the <code>PageDetail</code> object's fields, if it is present. Otherwise, I would like to set it to some default values.</p>
  
  <p>My question is, is there a better way to rewrite this? My current code seems a bit long and tedious, and I would like to know if there is a more concise way of doing this.</p>