class FiltersParser {

    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;
    }

    private  FiltersParser();

}