1package org.apache.archiva.admin.model.proxyconnector;
2/*3 * Licensed to the Apache Software Foundation (ASF) under one4 * or more contributor license agreements. See the NOTICE file5 * distributed with this work for additional information6 * regarding copyright ownership. The ASF licenses this file7 * to you under the Apache License, Version 2.0 (the8 * "License"); you may not use this file except in compliance9 * with the License. You may obtain a copy of the License at10 *11 * http://www.apache.org/licenses/LICENSE-2.012 *13 * Unless required by applicable law or agreed to in writing,14 * software distributed under the License is distributed on an15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY16 * KIND, either express or implied. See the License for the17 * specific language governing permissions and limitations18 * under the License.19 */2021import org.apache.archiva.admin.model.beans.ProxyConnector;
22import org.apache.commons.collections4.Predicate;
23import org.apache.commons.lang3.StringUtils;
2425/**26 * @author Olivier Lamy27 * @since 1.4-M128 */29publicclassProxyConnectorSelectionPredicate30implements Predicate
31 {
32private String sourceId;
3334private String targetId;
3536publicProxyConnectorSelectionPredicate( String sourceId, String targetId )
37 {
38this.sourceId = sourceId;
39this.targetId = targetId;
40 }
4142 @Override
43publicboolean evaluate( Object object )
44 {
45boolean satisfies = false;
4647if ( object instanceof ProxyConnector )
48 {
49ProxyConnector/../../org/apache/archiva/admin/model/beans/ProxyConnector.html#ProxyConnector">ProxyConnector connector = (ProxyConnector) object;
50return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils.equals( targetId,
51 connector.getTargetRepoId() ) );
52 }
5354return satisfies;
55 }
56 }