// If status was set to PUBLICATION however no publication date was specified then throw exception
if (!pubDateModel.isDefined()) {
throw requiredFieldWhen("visibility status is " + status, "visibility", "publication-date");
}
PublicationDate publicationDate = getPublicationDate(nodeModel, original.getPublicationDate());
return new Visibility(publicationDate);
} else {
return new Visibility(status);
}
}