File tree Expand file tree Collapse file tree 3 files changed +3
-21
lines changed
main/java/org/springframework/ldap/query
test/java/org/springframework/ldap/query Expand file tree Collapse file tree 3 files changed +3
-21
lines changed Original file line number Diff line number Diff line change @@ -105,17 +105,4 @@ public interface ConditionCriteria {
105
105
*/
106
106
ConditionCriteria not ();
107
107
108
- /**
109
- * Appends an {@link org.springframework.ldap.filter.ProximityFilter}.
110
- * @param value the value to compare with.
111
- * @return an ContainerCriteria instance that can be used to continue append more
112
- * criteria or as the LdapQuery instance to be used as instance to e.g.
113
- * {@link org.springframework.ldap.core.LdapOperations#search(LdapQuery, org.springframework.ldap.core.ContextMapper)}.
114
- * @since 3.3
115
- * @see org.springframework.ldap.filter.EqualsFilter
116
- */
117
- default ContainerCriteria near (String value ) {
118
- throw new UnsupportedOperationException ();
119
- }
120
-
121
108
}
Original file line number Diff line number Diff line change 23
23
import org .springframework .ldap .filter .LikeFilter ;
24
24
import org .springframework .ldap .filter .NotFilter ;
25
25
import org .springframework .ldap .filter .PresentFilter ;
26
- import org .springframework .ldap .filter .ProximityFilter ;
27
26
import org .springframework .ldap .filter .WhitespaceWildcardsFilter ;
28
27
29
28
/**
@@ -73,11 +72,6 @@ public ContainerCriteria isPresent() {
73
72
return appendToParent (new PresentFilter (this .attribute ));
74
73
}
75
74
76
- @ Override
77
- public ContainerCriteria near (String value ) {
78
- return appendToParent (new ProximityFilter (this .attribute , value ));
79
- }
80
-
81
75
private ContainerCriteria appendToParent (Filter filter ) {
82
76
return this .parent .append (negateIfApplicable (filter ));
83
77
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2005-2023 the original author or authors.
2
+ * Copyright 2005-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
18
18
19
19
import org .junit .Test ;
20
20
21
+ import org .springframework .ldap .filter .ProximityFilter ;
21
22
import org .springframework .ldap .support .LdapUtils ;
22
23
23
24
import static org .assertj .core .api .Assertions .assertThat ;
@@ -75,7 +76,7 @@ public void buildPresent() {
75
76
76
77
@ Test
77
78
public void buildProximity () {
78
- LdapQuery result = LdapQueryBuilder .query ().where ( "cn" ). near ( "John Doe" );
79
+ LdapQuery result = LdapQueryBuilder .query ().filter ( new ProximityFilter ( "cn" , "John Doe" ) );
79
80
80
81
assertThat (result .filter ().encode ()).isEqualTo ("(cn~=John Doe)" );
81
82
}
You can’t perform that action at this time.
0 commit comments