LDAP-263: Extracted interface to minimize class coupling in query package.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2005-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.ldap.query;
|
||||
|
||||
import org.springframework.ldap.filter.Filter;
|
||||
|
||||
/**
|
||||
* @author Mattias Hellborg Arthursson
|
||||
*/
|
||||
interface AppendableContainerCriteria extends ContainerCriteria {
|
||||
ContainerCriteria append(Filter filter);
|
||||
}
|
||||
@@ -30,11 +30,11 @@ import org.springframework.ldap.filter.WhitespaceWildcardsFilter;
|
||||
* @since 2.0
|
||||
*/
|
||||
class DefaultConditionCriteria implements ConditionCriteria {
|
||||
private final DefaultContainerCriteria parent;
|
||||
private final AppendableContainerCriteria parent;
|
||||
private final String attribute;
|
||||
private boolean negated = false;
|
||||
|
||||
DefaultConditionCriteria(DefaultContainerCriteria parent, String attribute) {
|
||||
DefaultConditionCriteria(AppendableContainerCriteria parent, String attribute) {
|
||||
this.parent = parent;
|
||||
this.attribute = attribute;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import static org.springframework.ldap.query.CriteriaContainerType.OR;
|
||||
* @author Mattias Hellborg Arthursson
|
||||
* @since 2.0
|
||||
*/
|
||||
class DefaultContainerCriteria implements ContainerCriteria {
|
||||
class DefaultContainerCriteria implements AppendableContainerCriteria {
|
||||
private final Set<Filter> filters = new LinkedHashSet<Filter>();
|
||||
private final LdapQuery topQuery;
|
||||
private CriteriaContainerType type;
|
||||
@@ -38,7 +38,8 @@ class DefaultContainerCriteria implements ContainerCriteria {
|
||||
this.topQuery = topQuery;
|
||||
}
|
||||
|
||||
DefaultContainerCriteria append(Filter filter) {
|
||||
@Override
|
||||
public DefaultContainerCriteria append(Filter filter) {
|
||||
this.filters.add(filter);
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user