class UriEncoding {

    public static String encodeQueryParam(final String queryParam, final EncodingType encType) {
        requireNonNull(queryParam);
        requireNonNull(encType);

        if (encType == EncodingType.FORM_URL_ENCODED) {
            return encodeFormUrlEncoded(queryParam);
        } else {
            return encodeRFC3986UriComponent(queryParam, ALLOWED_IN_QUERY_PARAM);
        }
    }

}