test_class.declarator: CHARS_UNSUPPORTED_RELAXED = " ä\"%";
test_class.modifier: private static final
test_class.original_string: private static final String CHARS_UNSUPPORTED_RELAXED = " ä\"%";
test_class.type: String
test_class.var_name: CHARS_UNSUPPORTED_RELAXED
test_class.declarator: CHARS_UNSUPPORTED_STRICT = "\\[]{}|"
test_class.modifier: private static final
test_class.original_string: private static final String CHARS_UNSUPPORTED_STRICT = "\\[]{}|";
test_class.type: String
test_class.var_name: CHARS_UNSUPPORTED_STRICT
test_class.declarator: CHARS_SUPPORTED = "!#$&'()*+,/:;=?@aZ0"
test_class.modifier: private static final
test_class.original_string: private static final String CHARS_SUPPORTED = "!#$&'()*+,/:;=?@aZ0";
test_class.type: String
test_class.var_name: CHARS_SUPPORTED
test_class.declarator: MANY_DIFFERENT_CHARS = "!\"#$%&'()*+,/:;=?@[\\]{|} äaZ0";
test_class.modifier: private static final
test_class.original_string: private static final String MANY_DIFFERENT_CHARS = "!\"#$%&'()*+,/:;=?@[\\]{|} äaZ0";
test_class.type: String
test_class.var_name: MANY_DIFFERENT_CHARS
test_class.declarator: MANY_DIFFERENT_CHARS_QUERY_PARAM_ENCODED_RFC3986 =
              "!%22%23$%25%26'()*%2B,/:;%3D?@%5B%5C%5D%7B%7C%7D%20%C3%A4aZ0"
test_class.modifier: private static final
test_class.original_string: private static final String MANY_DIFFERENT_CHARS_QUERY_PARAM_ENCODED_RFC3986 =
              "!%22%23$%25%26'()*%2B,/:;%3D?@%5B%5C%5D%7B%7C%7D%20%C3%A4aZ0";
test_class.type: String
test_class.var_name: MANY_DIFFERENT_CHARS_QUERY_PARAM_ENCODED_RFC3986
test_class.file: services/gateway/endpoints/src/test/java/org/eclipse/ditto/services/gateway/endpoints/utils/UriEncodingTest.java
test_class.identifier: UriEncodingTest
test_case.body: @Test
      public void encodeQueryFormUrlEncoded() {
          assertEquals("foo", UriEncoding.encodeQuery("foo", FORM_URL_ENCODED));
          assertEquals("foo=bar%2F%2B&baz=1", UriEncoding.encodeQuery("foo=bar/+&baz=1", FORM_URL_ENCODED));
          assertEquals("%21%22%23%24%25&%27%28%29*%2B%2C%2F%3A%3B=%3F%40%5B%5C%5D%7B%7C%7D+%C3%A4aZ0",
                  UriEncoding.encodeQuery(MANY_DIFFERENT_CHARS, FORM_URL_ENCODED));
      }
test_case.class_method_signature: UriEncodingTest.encodeQueryFormUrlEncoded()
test_case.full_signature: @Test public void encodeQueryFormUrlEncoded()
test_case.identifier: encodeQueryFormUrlEncoded
test_case.invocations: assertEquals encodeQuery assertEquals encodeQuery assertEquals encodeQuery
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void encodeQueryFormUrlEncoded()
focal_class.declarator: ENCODING = StandardCharsets.UTF_8.name()
focal_class.modifier: private static final
focal_class.original_string: private static final String ENCODING = StandardCharsets.UTF_8.name();
focal_class.type: String
focal_class.var_name: ENCODING
focal_class.declarator: ALLOWED_IN_PATH = c -> isPchar(c) || '/' == c
focal_class.modifier: private static final
focal_class.original_string: private static final IntPredicate ALLOWED_IN_PATH = c -> isPchar(c) || '/' == c;
focal_class.type: IntPredicate
focal_class.var_name: ALLOWED_IN_PATH
focal_class.declarator: ALLOWED_IN_PATH_SEGMENT = UriEncoding::isPchar
focal_class.modifier: private static final
focal_class.original_string: private static final IntPredicate ALLOWED_IN_PATH_SEGMENT = UriEncoding::isPchar;
focal_class.type: IntPredicate
focal_class.var_name: ALLOWED_IN_PATH_SEGMENT
focal_class.declarator: ALLOWED_IN_QUERY = c -> c != '+' && (isPchar(c) || '/' == c || '?' == c)
focal_class.modifier: private static final
focal_class.original_string: private static final IntPredicate ALLOWED_IN_QUERY = c -> c != '+' && (isPchar(c) || '/' == c || '?' == c);
focal_class.type: IntPredicate
focal_class.var_name: ALLOWED_IN_QUERY
focal_class.declarator: ALLOWED_IN_QUERY_PARAM =
              c -> !('=' == c || '&' == c) && ALLOWED_IN_QUERY.test(c)
focal_class.modifier: private static final
focal_class.original_string: private static final IntPredicate ALLOWED_IN_QUERY_PARAM =
              c -> !('=' == c || '&' == c) && ALLOWED_IN_QUERY.test(c);
focal_class.type: IntPredicate
focal_class.var_name: ALLOWED_IN_QUERY_PARAM
focal_class.file: services/gateway/endpoints/src/main/java/org/eclipse/ditto/services/gateway/endpoints/utils/UriEncoding.java
focal_class.identifier: UriEncoding
focal_class.class_method_signature: UriEncoding.encodePath(final String path)
focal_class.full_signature: public static String encodePath(final String path)
focal_class.identifier: encodePath
focal_class.modifiers: public static
focal_class.parameters: (final String path)
focal_class.return: String
focal_class.signature: String encodePath(final String path)
focal_class.class_method_signature: UriEncoding.encodePathSegment(final String pathSegment)
focal_class.full_signature: public static String encodePathSegment(final String pathSegment)
focal_class.identifier: encodePathSegment
focal_class.modifiers: public static
focal_class.parameters: (final String pathSegment)
focal_class.return: String
focal_class.signature: String encodePathSegment(final String pathSegment)
focal_class.class_method_signature: UriEncoding.encodeQuery(final String query, final EncodingType encType)
focal_class.full_signature: public static String encodeQuery(final String query, final EncodingType encType)
focal_class.identifier: encodeQuery
focal_class.modifiers: public static
focal_class.parameters: (final String query, final EncodingType encType)
focal_class.return: String
focal_class.signature: String encodeQuery(final String query, final EncodingType encType)
focal_class.class_method_signature: UriEncoding.encodeQueryParam(final String queryParam, final EncodingType encType)
focal_class.full_signature: public static String encodeQueryParam(final String queryParam, final EncodingType encType)
focal_class.identifier: encodeQueryParam
focal_class.modifiers: public static
focal_class.parameters: (final String queryParam, final EncodingType encType)
focal_class.return: String
focal_class.signature: String encodeQueryParam(final String queryParam, final EncodingType encType)
focal_class.class_method_signature: UriEncoding.decode(final String source, final EncodingType encType)
focal_class.full_signature: public static String decode(final String source, final EncodingType encType)
focal_class.identifier: decode
focal_class.modifiers: public static
focal_class.parameters: (final String source, final EncodingType encType)
focal_class.return: String
focal_class.signature: String decode(final String source, final EncodingType encType)
focal_class.class_method_signature: UriEncoding.encodeFormUrlEncoded(final String s)
focal_class.full_signature: private static String encodeFormUrlEncoded(final String s)
focal_class.identifier: encodeFormUrlEncoded
focal_class.modifiers: private static
focal_class.parameters: (final String s)
focal_class.return: String
focal_class.signature: String encodeFormUrlEncoded(final String s)
focal_class.class_method_signature: UriEncoding.decodeFormUrlEncoded(final String source)
focal_class.full_signature: private static String decodeFormUrlEncoded(final String source)
focal_class.identifier: decodeFormUrlEncoded
focal_class.modifiers: private static
focal_class.parameters: (final String source)
focal_class.return: String
focal_class.signature: String decodeFormUrlEncoded(final String source)
focal_class.class_method_signature: UriEncoding.decodeRFC3986(final String source)
focal_class.full_signature: @SuppressWarnings("squid:S3776") // simplification of this method would be difficult without sacrificing performance private static String decodeRFC3986(final String source)
focal_class.identifier: decodeRFC3986
focal_class.modifiers: @SuppressWarnings("squid:S3776") // simplification of this method would be difficult without sacrificing performance private static
focal_class.parameters: (final String source)
focal_class.return: String
focal_class.signature: String decodeRFC3986(final String source)
focal_class.class_method_signature: UriEncoding.encodeRFC3986UriComponent(final String source, final IntPredicate allowedChars)
focal_class.full_signature: private static String encodeRFC3986UriComponent(final String source, final IntPredicate allowedChars)
focal_class.identifier: encodeRFC3986UriComponent
focal_class.modifiers: private static
focal_class.parameters: (final String source, final IntPredicate allowedChars)
focal_class.return: String
focal_class.signature: String encodeRFC3986UriComponent(final String source, final IntPredicate allowedChars)
focal_class.class_method_signature: UriEncoding.encodeBytes(final byte[] source, final IntPredicate allowedChars)
focal_class.full_signature: private static byte[] encodeBytes(final byte[] source, final IntPredicate allowedChars)
focal_class.identifier: encodeBytes
focal_class.modifiers: private static
focal_class.parameters: (final byte[] source, final IntPredicate allowedChars)
focal_class.return: byte[]
focal_class.signature: byte[] encodeBytes(final byte[] source, final IntPredicate allowedChars)
focal_class.class_method_signature: UriEncoding.isPchar(final int c)
focal_class.full_signature: private static boolean isPchar(final int c)
focal_class.identifier: isPchar
focal_class.modifiers: private static
focal_class.parameters: (final int c)
focal_class.return: boolean
focal_class.signature: boolean isPchar(final int c)
focal_class.class_method_signature: UriEncoding.isUnreserved(final int c)
focal_class.full_signature: private static boolean isUnreserved(final int c)
focal_class.identifier: isUnreserved
focal_class.modifiers: private static
focal_class.parameters: (final int c)
focal_class.return: boolean
focal_class.signature: boolean isUnreserved(final int c)
focal_class.class_method_signature: UriEncoding.isAlpha(final int c)
focal_class.full_signature: private static boolean isAlpha(final int c)
focal_class.identifier: isAlpha
focal_class.modifiers: private static
focal_class.parameters: (final int c)
focal_class.return: boolean
focal_class.signature: boolean isAlpha(final int c)
focal_class.class_method_signature: UriEncoding.isDigit(final int c)
focal_class.full_signature: private static boolean isDigit(final int c)
focal_class.identifier: isDigit
focal_class.modifiers: private static
focal_class.parameters: (final int c)
focal_class.return: boolean
focal_class.signature: boolean isDigit(final int c)
focal_class.class_method_signature: UriEncoding.isSubDelimiter(final int c)
focal_class.full_signature: private static boolean isSubDelimiter(final int c)
focal_class.identifier: isSubDelimiter
focal_class.modifiers: private static
focal_class.parameters: (final int c)
focal_class.return: boolean
focal_class.signature: boolean isSubDelimiter(final int c)
focal_method.body: public static String encodeQuery(final String query, final EncodingType encType) {
          requireNonNull(query);
          requireNonNull(encType);
  
          if (encType == EncodingType.FORM_URL_ENCODED) {
              return encodeFormUrlEncoded(query) //
                      .replaceAll("%3D", "=") //
                      .replaceAll("%26", "&");
          } else {
              return encodeRFC3986UriComponent(query, ALLOWED_IN_QUERY);
          }
      }
focal_method.class_method_signature: UriEncoding.encodeQuery(final String query, final EncodingType encType)
focal_method.full_signature: public static String encodeQuery(final String query, final EncodingType encType)
focal_method.identifier: encodeQuery
focal_method.invocations: requireNonNull requireNonNull replaceAll replaceAll encodeFormUrlEncoded encodeRFC3986UriComponent
focal_method.modifiers: public static
focal_method.parameters: (final String query, final EncodingType encType)
focal_method.return: String
focal_method.signature: String encodeQuery(final String query, final EncodingType encType)