Date (@NotNull String string) { try { return DatatypeFactory.newInstance().newXMLGregorianCalendar(string).toGregorianCalendar().getTime(); } catch (DatatypeConfigurationException e) { throw new RuntimeException("Error configuring datatype factory", e); } }