mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-01 18:35:37 +08:00
增加and 和or
This commit is contained in:
@@ -188,6 +188,17 @@ public interface Permission extends Serializable {
|
||||
*/
|
||||
interface DataAccessPredicate<T extends DataAccessConfig> extends Predicate<DataAccessConfig> {
|
||||
boolean test(DataAccessConfig config);
|
||||
|
||||
|
||||
@Override
|
||||
default DataAccessPredicate<T> and(Predicate<? super DataAccessConfig> other) {
|
||||
return (t) -> test(t) && other.test(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
default DataAccessPredicate<T> or(Predicate<? super DataAccessConfig> other) {
|
||||
return (t) -> test(t) || other.test(t);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user