ElasticVersion: Replace unchecked throw w/ javadoc

Change-Id: I5324c6b61e81bcd038bd25b3c650e3503f1cc1df
This commit is contained in:
Marco Miller
2020-05-13 12:49:46 -04:00
parent a15c9dffe9
commit a6a41d9ef7

View File

@@ -47,7 +47,14 @@ public enum ElasticVersion {
}
}
public static ElasticVersion forVersion(String version) throws UnsupportedVersion {
/**
* Convert a version String to an ElasticVersion if supported.
*
* @param version for which to return an ElasticVersion
* @return the corresponding ElasticVersion if supported
* @throws UnsupportedVersion
*/
public static ElasticVersion forVersion(String version) {
for (ElasticVersion value : ElasticVersion.values()) {
if (value.pattern.matcher(version).matches()) {
return value;