class ViewCustomizer {

    public List<FilterDefinition> getFilterDefinitions() {
        final List<ConsumeRequest.Filter> requestFilters = consumeRequest.getFilters();

        // Determine if we should apply record filters
        // but if the view has enforced record filtering, don't bypass its logic, add onto it.
        final List<FilterDefinition> configuredFilters = new ArrayList<>();
        if (requestFilters != null && !requestFilters.isEmpty()) {
            // Retrieve all available filters
            final Map<Long, Filter> allowedFilters = new HashMap<>();

            // Build list of allowed filters
            for (final ViewToFilterOptional allowedFilter : view.getOptionalFilters()) {
                allowedFilters.put(allowedFilter.getFilter().getId(), allowedFilter.getFilter());
            }

            // Convert the String array into an actual array
            for (final ConsumeRequest.Filter requestedFilter: requestFilters) {
                // Convert to a long
                final Long requestedFilterId = requestedFilter.getFilterId();
                final Map<String, String> requestedFilterOptions = requestedFilter.getOptions();

                // See if its an allowed filter
                if (!allowedFilters.containsKey(requestedFilterId)) {
                    // Skip not allowed filters
                    continue;
                }
                // Define it
                final Filter filter = allowedFilters.get(requestedFilterId);
                final FilterDefinition filterDefinition = new FilterDefinition(filter, requestedFilterOptions);

                // Configure it
                configuredFilters.add(filterDefinition);
            }
        }
        return configuredFilters;
    }

    public  ViewCustomizer(final View view, final ConsumeRequest consumeRequest);

}