private void parseOptions() {
        String joinedRequestHeaders = super.getString(keys("custom.headers.request"), "", Predicates.anyOk(), "");
        if (!joinedRequestHeaders.isEmpty()) {
            requestHeaders = Arrays.asList(joinedRequestHeaders.split(","));
        }

        String joinedResponseHeaders = super.getString(keys("custom.headers.response"), "", Predicates.anyOk(), "");
        if (!joinedResponseHeaders.isEmpty()) {
            responseHeaders = Arrays.asList(joinedResponseHeaders.split(","));
        }

        String joinedQueryParams = super.getString(keys("custom.query-params"), "", Predicates.anyOk(), "");
        if (!joinedQueryParams.isEmpty()) {
            queryParams = Arrays.asList(joinedQueryParams.split(","));
        }

        // TODO(msavy): consider adding #getArray into GenericOptionsParser
        String joinedWriteTo = super.getString(keys("write-to"), "REMOTE", Predicates.anyOk(), "");
        if (!joinedWriteTo.isEmpty()) {
            Set<WriteTo> writeTo = new HashSet<>();
            for (String rawEnum : joinedWriteTo.strip().split(",")) {
                try {
                    writeTo.add(WriteTo.valueOf(rawEnum.strip().toUpperCase()));
                } catch(RuntimeException rte) {
                    throw InvalidOptionConfigurationException.constraintFailure(
                            "write-to",
                            "enum",
                            rawEnum,
                            "Valid inputs are: " + Arrays.toString(WriteTo.values())
                    );
                }
            }
            this.writeTo = writeTo;
        }
    }
Options parser for Elasticsearch metrics

@author Marc Savy {@literal <marc@blackparrotlabs.io>}
gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/EsMetricsClientOptionsParser.java