#1241: CustomResultFilter.kt

projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/api/impl/CustomResultFilter.kt Interface — Persistence / DAO Result Filtering, projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/api/impl/CustomResultFilter.kt 35 lines · 4 code · 29 comments · 2 blank
Simple interface that allows DAO classes to provide custom result-list filtering. Implementations decide per-element whether it should be included in the final result list, with access to already-written elements for dependency-based decisions.

Architecture

A single-method generic interface used by BaseDao and related persistence infrastructure to allow domain-specific post-query filtering before a result list is returned to the caller. It sits in the api/impl package alongside DBPredicate, DBFilter, and other low-level query infrastructure.

Contract

fun match(list: MutableList<O>, element: O): Boolean
ParameterDescription
listThe result list of already-written (accepted) elements. Allows dependency-based filtering — e.g., filter out element if a "better" element already exists.
elementThe current element being checked for inclusion.
Returntrue to include the element, false to exclude it.

Usage Context

DAO classes can supply a CustomResultFilter implementation when querying. The filter is applied after the database query but before the result is returned. This is particularly useful for:

Git History

868d6abb7 2025 -> 2026
63081666f Source file headers: 2024-> 2025.
0d183e5df Migration stuff in progress...
923f5c64b Migration stuff in progress...
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
5f7ef41b8 Copyright 2021 -> 2022
ceb63e8a1 Source code header: (C) 2001-2021.
7c79f1922 Copyright of source header -> 2020.
73895b7df WIP: CustomResultFilter...
1165d1557 WIP Addresses and CustomResultFilter introduced.
aba5af116 BaseDao.contains and BaseDao.getHistoryEntries are now public. WIP: MagicFilter...
507854213 WIP: MagicFilter...
dd5ca38ac CopyRight of all java file-header updated or created.
9af6f6dbd PROJECTFORGE-2282 improve error handling on excel import