test_class.file: request-parameters/src/test/java/eu/neoteric/starter/request/FiltersParserTest.java
test_class.identifier: FiltersParserTest
test_case.body: @Test
      public void testMultipleNestedOperators() throws Exception {
          Map<String, Object> rawFilters = readFiltersFromResources("MultipleNestedOperators.json");
  
          Map<RequestObject, Object> filters = FiltersParser.parseFilters(rawFilters);
          Assertions.assertThat(filters)
                  .hasSize(3)
                  .containsOnlyKeys(RequestField.of("name"), RequestField.of("lastName"), RequestLogicalOperator.of(LogicalOperatorType.OR));
  
          assertThat((Map) filters.get(RequestField.of("name")))
                  .hasSize(2)
                  .containsEntry(RequestOperator.of(OperatorType.STARTS_WITH), "John")
                  .containsEntry(RequestOperator.of(OperatorType.IN), Lists.newArrayList("Johnny", "Abc"));
  
          assertThat((Map) filters.get(RequestField.of("lastName")))
                  .hasSize(1)
                  .containsEntry(RequestLogicalOperator.of(LogicalOperatorType.OR), ImmutableMap.of(
                          RequestOperator.of(OperatorType.STARTS_WITH), "John",
                          RequestOperator.of(OperatorType.IN), Lists.newArrayList("Johnny", "Abc")
                  ));
  
          assertThat((Map) filters.get(RequestLogicalOperator.of(LogicalOperatorType.OR)))
                  .hasSize(2)
                  .containsEntry(RequestField.of("name"), ImmutableMap.of(RequestOperator.of(OperatorType.EQUAL), "John"))
                  .containsEntry(RequestField.of("last"), ImmutableMap.of(RequestOperator.of(OperatorType.EQUAL), "Doe"));
      }
test_case.class_method_signature: FiltersParserTest.testMultipleNestedOperators()
test_case.full_signature: @Test public void testMultipleNestedOperators()
test_case.identifier: testMultipleNestedOperators
test_case.invocations: readFiltersFromResources parseFilters containsOnlyKeys hasSize assertThat of of of containsEntry containsEntry hasSize assertThat get of of of newArrayList containsEntry hasSize assertThat get of of of of of newArrayList containsEntry containsEntry hasSize assertThat get of of of of of of of
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMultipleNestedOperators()
focal_class.declarator: LOG = LoggerFactory.getLogger(FiltersParser.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(FiltersParser.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.file: request-parameters/src/main/java/eu/neoteric/starter/request/FiltersParser.java
focal_class.identifier: FiltersParser
focal_class.class_method_signature: FiltersParser.FiltersParser()
focal_class.full_signature: private  FiltersParser()
focal_class.identifier: FiltersParser
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  FiltersParser()
focal_class.class_method_signature: FiltersParser.parseFilters(Map<String, Object> rawFilters)
focal_class.full_signature: public static Map<RequestObject, Object> parseFilters(Map<String, Object> rawFilters)
focal_class.identifier: parseFilters
focal_class.modifiers: public static
focal_class.parameters: (Map<String, Object> rawFilters)
focal_class.return: Map<RequestObject, Object>
focal_class.signature: Map<RequestObject, Object> parseFilters(Map<String, Object> rawFilters)
focal_class.class_method_signature: FiltersParser.processRootLogicalOperatorValue(Map<String, Object> orEntry)
focal_class.full_signature: private static Map<RequestObject, Object> processRootLogicalOperatorValue(Map<String, Object> orEntry)
focal_class.identifier: processRootLogicalOperatorValue
focal_class.modifiers: private static
focal_class.parameters: (Map<String, Object> orEntry)
focal_class.return: Map<RequestObject, Object>
focal_class.signature: Map<RequestObject, Object> processRootLogicalOperatorValue(Map<String, Object> orEntry)
focal_class.class_method_signature: FiltersParser.processLogicalOperatorValue(Map<String, Object> orEntry)
focal_class.full_signature: private static Map<RequestObject, Object> processLogicalOperatorValue(Map<String, Object> orEntry)
focal_class.identifier: processLogicalOperatorValue
focal_class.modifiers: private static
focal_class.parameters: (Map<String, Object> orEntry)
focal_class.return: Map<RequestObject, Object>
focal_class.signature: Map<RequestObject, Object> processLogicalOperatorValue(Map<String, Object> orEntry)
focal_class.class_method_signature: FiltersParser.processFieldValue(Map<String, Object> fieldEntry)
focal_class.full_signature: private static Map<RequestObject, Object> processFieldValue(Map<String, Object> fieldEntry)
focal_class.identifier: processFieldValue
focal_class.modifiers: private static
focal_class.parameters: (Map<String, Object> fieldEntry)
focal_class.return: Map<RequestObject, Object>
focal_class.signature: Map<RequestObject, Object> processFieldValue(Map<String, Object> fieldEntry)
focal_class.class_method_signature: FiltersParser.isLogicalOperator(String key)
focal_class.full_signature: private static boolean isLogicalOperator(String key)
focal_class.identifier: isLogicalOperator
focal_class.modifiers: private static
focal_class.parameters: (String key)
focal_class.return: boolean
focal_class.signature: boolean isLogicalOperator(String key)
focal_class.class_method_signature: FiltersParser.isOperator(String key)
focal_class.full_signature: private static boolean isOperator(String key)
focal_class.identifier: isOperator
focal_class.modifiers: private static
focal_class.parameters: (String key)
focal_class.return: boolean
focal_class.signature: boolean isOperator(String key)
focal_class.class_method_signature: FiltersParser.isField(String key)
focal_class.full_signature: private static boolean isField(String key)
focal_class.identifier: isField
focal_class.modifiers: private static
focal_class.parameters: (String key)
focal_class.return: boolean
focal_class.signature: boolean isField(String key)
focal_class.class_method_signature: FiltersParser.isNotOperatorNorLogicalOperator(String key)
focal_class.full_signature: private static boolean isNotOperatorNorLogicalOperator(String key)
focal_class.identifier: isNotOperatorNorLogicalOperator
focal_class.modifiers: private static
focal_class.parameters: (String key)
focal_class.return: boolean
focal_class.signature: boolean isNotOperatorNorLogicalOperator(String key)
focal_class.class_method_signature: FiltersParser.isNotFieldNorLogicalOperator(String key)
focal_class.full_signature: private static boolean isNotFieldNorLogicalOperator(String key)
focal_class.identifier: isNotFieldNorLogicalOperator
focal_class.modifiers: private static
focal_class.parameters: (String key)
focal_class.return: boolean
focal_class.signature: boolean isNotFieldNorLogicalOperator(String key)
focal_method.body: public static Map<RequestObject, Object> parseFilters(Map<String, Object> rawFilters) {
          Map<RequestObject, Object> requestParameters = new HashMap<>();
  
          rawFilters.forEach((key, entry) -> {
              if (isNotFieldNorLogicalOperator(key)) {
                  throw new IllegalStateException(key + " isNotFieldNorLogicalOperator");
              }
              if (isField(key)) {
                  if (!(entry instanceof Map)) {
                      throw new IllegalStateException("Bad value (" + entry + ") type for field: " + entry.getClass().toString());
                  }
                  requestParameters.put(RequestField.of(key), processFieldValue((Map) entry));
              } else {
                  if (!(entry instanceof Map)) {
                      throw new IllegalStateException("Bad value (" + entry + ") type for or operation: " + entry.getClass().toString());
                  }
                  requestParameters.put(RequestLogicalOperator.of(key), processRootLogicalOperatorValue((Map) entry));
              }
          });
          LOG.info("Parsed filters: {}", requestParameters);
          return requestParameters;
      }
focal_method.class_method_signature: FiltersParser.parseFilters(Map<String, Object> rawFilters)
focal_method.full_signature: public static Map<RequestObject, Object> parseFilters(Map<String, Object> rawFilters)
focal_method.identifier: parseFilters
focal_method.invocations: forEach isNotFieldNorLogicalOperator isField toString getClass put of processFieldValue toString getClass put of processRootLogicalOperatorValue info
focal_method.modifiers: public static
focal_method.parameters: (Map<String, Object> rawFilters)
focal_method.return: Map<RequestObject, Object>
focal_method.signature: Map<RequestObject, Object> parseFilters(Map<String, Object> rawFilters)