class HexMetaAnalyzer extends AbstractMetaAnalyzer {

    private static final Logger LOGGER = Logger.getLogger(HexMetaAnalyzer.class);
    private static final String DEFAULT_BASE_URL = "https://hex.pm";
    private static final String API_URL = "/api/packages/%s";

    HexMetaAnalyzer() {
        this.baseUrl = DEFAULT_BASE_URL;
    }

    /**
     * {@inheritDoc}
     */
    public boolean isApplicable(final Component component) {
        return component.getPurl() != null && PackageURL.StandardTypes.HEX.equals(component.getPurl().getType());
    }

    /**
     * {@inheritDoc}
     */
    public RepositoryType supportedRepositoryType() {
        return RepositoryType.HEX;
    }

    /**
     * {@inheritDoc}
     */
    public MetaModel analyze(final Component component) {<FILL_FUNCTION_BODY>}

}

        final MetaModel meta = new MetaModel(component);
        if (component.getPurl() != null) {

            final String packageName;
            if (component.getPurl().getNamespace() != null) {
                packageName = component.getPurl().getNamespace().replace("@", "%40") + "%2F" + component.getPurl().getName();
            } else {
                packageName = component.getPurl().getName();
            }

            final String url = String.format(baseUrl + API_URL, packageName);
            try (final CloseableHttpResponse response = processHttpRequest(url)) {
                if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
                    if (response.getEntity()!=null) {
                        String responseString = EntityUtils.toString(response.getEntity());
                        var jsonObject = new JSONObject(responseString);
                        final JSONArray releasesArray = jsonObject.getJSONArray("releases");
                        if (releasesArray.length() > 0) {
                            // The first one in the array is always the latest version
                            final JSONObject release = releasesArray.getJSONObject(0);
                            final String latest = release.optString("version", null);
                            meta.setLatestVersion(latest);
                            final String insertedAt = release.optString("inserted_at", null);
                            if (insertedAt != null) {
                                final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
                                try {
                                    final Date published = dateFormat.parse(insertedAt);
                                    meta.setPublishedTimestamp(published);
                                } catch (ParseException e) {
                                    LOGGER.warn("An error occurred while parsing published time", e);
                                }
                            }
                        }
                    }
                } else {
                    handleUnexpectedHttpResponse(LOGGER, url, response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase(), component);
                }
            } catch (IOException e) {
                handleRequestException(LOGGER, e);
            } catch (Exception ex) {
                throw new MetaAnalyzerException(ex);
            }
        }
        return meta;
    
<methods>public non-sealed void <init>() ,public void setRepositoryBaseUrl(java.lang.String) ,public void setRepositoryUsernameAndPassword(java.lang.String, java.lang.String) <variables>protected java.lang.String baseUrl,protected java.lang.String password,protected java.lang.String username