Class LdapRoleModelCriteriaBuilder
- java.lang.Object
-
- org.keycloak.models.map.storage.ldap.LdapModelCriteriaBuilder<LdapRoleEntity,RoleModel,LdapRoleModelCriteriaBuilder>
-
- org.keycloak.models.map.storage.ldap.role.LdapRoleModelCriteriaBuilder
-
- All Implemented Interfaces:
ModelCriteriaBuilder<RoleModel,LdapRoleModelCriteriaBuilder>
public class LdapRoleModelCriteriaBuilder extends LdapModelCriteriaBuilder<LdapRoleEntity,RoleModel,LdapRoleModelCriteriaBuilder>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.keycloak.models.map.storage.ModelCriteriaBuilder
ModelCriteriaBuilder.Operator
-
-
Constructor Summary
Constructors Constructor Description LdapRoleModelCriteriaBuilder(LdapMapRoleMapperConfig roleMapperConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LdapRoleModelCriteriaBuilder
and(LdapRoleModelCriteriaBuilder... builders)
Creates and returns a new instance ofModelCriteriaBuilder
that combines the given builders with the Boolean AND operator.LdapRoleModelCriteriaBuilder
compare(SearchableModelField<? super RoleModel> modelField, ModelCriteriaBuilder.Operator op, Object... value)
Adds a constraint for the given model field to this criteria builder and returns a criteria builder that is combined with the the new constraint.String
getClientId()
String
getRealmId()
Boolean
isClientRole()
LdapRoleModelCriteriaBuilder
not(LdapRoleModelCriteriaBuilder builder)
Creates and returns a new instance ofModelCriteriaBuilder
that negates the given builder.LdapRoleModelCriteriaBuilder
or(LdapRoleModelCriteriaBuilder... builders)
Creates and returns a new instance ofModelCriteriaBuilder
that combines the given builders with the Boolean OR operator.LdapRoleModelCriteriaBuilder
withCustomFilter(String customFilter)
-
Methods inherited from class org.keycloak.models.map.storage.ldap.LdapModelCriteriaBuilder
equal, getPredicateFunc, in
-
-
-
-
Constructor Detail
-
LdapRoleModelCriteriaBuilder
public LdapRoleModelCriteriaBuilder(LdapMapRoleMapperConfig roleMapperConfig)
-
-
Method Detail
-
getClientId
public String getClientId()
-
isClientRole
public Boolean isClientRole()
-
getRealmId
public String getRealmId()
-
and
public LdapRoleModelCriteriaBuilder and(LdapRoleModelCriteriaBuilder... builders)
Description copied from interface:ModelCriteriaBuilder
Creates and returns a new instance ofModelCriteriaBuilder
that combines the given builders with the Boolean AND operator.Predicate coming out of
and
on an empty array ofbuilders
(i.e. empty conjunction) is alwaystrue
.cb = storage.getCriteriaBuilder(); storage.read(cb.or( cb.and(cb.compare(FIELD1, EQ, 1), cb.compare(FIELD2, EQ, 2)), cb.and(cb.compare(FIELD1, EQ, 3), cb.compare(FIELD2, EQ, 4)) );
- Specified by:
and
in interfaceModelCriteriaBuilder<RoleModel,LdapRoleModelCriteriaBuilder>
- Overrides:
and
in classLdapModelCriteriaBuilder<LdapRoleEntity,RoleModel,LdapRoleModelCriteriaBuilder>
-
or
public LdapRoleModelCriteriaBuilder or(LdapRoleModelCriteriaBuilder... builders)
Description copied from interface:ModelCriteriaBuilder
Creates and returns a new instance ofModelCriteriaBuilder
that combines the given builders with the Boolean OR operator.Predicate coming out of
or
on an empty array ofbuilders
(i.e. empty disjunction) is alwaysfalse
.cb = storage.getCriteriaBuilder(); storage.read(cb.or( cb.compare(FIELD1, EQ, 1).compare(FIELD2, EQ, 2), cb.compare(FIELD1, EQ, 3).compare(FIELD2, EQ, 4) );
- Specified by:
or
in interfaceModelCriteriaBuilder<RoleModel,LdapRoleModelCriteriaBuilder>
- Overrides:
or
in classLdapModelCriteriaBuilder<LdapRoleEntity,RoleModel,LdapRoleModelCriteriaBuilder>
-
not
public LdapRoleModelCriteriaBuilder not(LdapRoleModelCriteriaBuilder builder)
Description copied from interface:ModelCriteriaBuilder
Creates and returns a new instance ofModelCriteriaBuilder
that negates the given builder.Note that if the
builder
has no condition yet, there is nothing to negate: empty negation is alwaystrue
.- Specified by:
not
in interfaceModelCriteriaBuilder<RoleModel,LdapRoleModelCriteriaBuilder>
- Overrides:
not
in classLdapModelCriteriaBuilder<LdapRoleEntity,RoleModel,LdapRoleModelCriteriaBuilder>
- Returns:
-
compare
public LdapRoleModelCriteriaBuilder compare(SearchableModelField<? super RoleModel> modelField, ModelCriteriaBuilder.Operator op, Object... value)
Description copied from interface:ModelCriteriaBuilder
Adds a constraint for the given model field to this criteria builder and returns a criteria builder that is combined with the the new constraint. The resulting constraint is a logical conjunction (i.e. AND) of the original constraint present in thisModelCriteriaBuilder
and the given operator.- Parameters:
modelField
- Field on the logical model to be constrainedop
- Operatorvalue
- Additional operands of the operator.- Returns:
-
withCustomFilter
public LdapRoleModelCriteriaBuilder withCustomFilter(String customFilter)
-
-