/** * Parses a version string. The version string must have the format {@code MAJOR.MINOR.REVISION IMPL}, where {@code MAJOR} is the major version (integer), * {@code MINOR} is the minor version (integer), {@code REVISION} is the revision version (string, optional) and {@code IMPL} is implementation-specific * information (string, optional). * * @param version the API version string * * @return the parsed {@link APIVersion} */ public static APIVersion apiParseVersion(String version) { return apiParseVersion(version, null); }
/** * Returns the {@link APIVersion} value of the specified option. * * @param option the option to query */ @Nullable public static APIVersion apiParseVersion(Configuration<?> option) { APIVersion version; Object state = option.get(); if (state instanceof String) { version = apiParseVersion((String)state, null); } else if (state instanceof APIVersion) { version = (APIVersion)state; } else { version = null; } return version; }
APIVersion apiVersion = apiParseVersion(versionString);
APIVersion version = apiParseVersion(versionString, "OpenGL ES");
APIVersion apiVersion = apiParseVersion(versionString);