Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.apache.maven.artifact.resolver.filter;
  
  /*
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you 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.
  */
 
 import java.util.Set;

Filter to only retain objects in the given scope or better. This implementation allows the accumulation of multiple scopes and their associated implied scopes, so that the user can filter apply a series of implication rules in a single step. This should be a more efficient implementation of multiple standard ScopeArtifactFilter instances ORed together.

Author(s):
Brett Porter
jdcasey
 
 {
 
     private Set<Stringscopes;

    
Create a new filter with the specified scopes and their implied scopes enabled.

Parameters:
scopes The scopes to enable, along with all implied scopes, may be null.
 
     public CumulativeScopeArtifactFilterCollection<Stringscopes )
     {
         this. = new HashSet<String>();
 
         addScopesscopes );
     }

    
Creates a new filter that combines the specified filters.

Parameters:
filters The filters to combine, may be null.
 
     {
         this. = new HashSet<String>();
 
         if ( filters != null )
         {
             for ( CumulativeScopeArtifactFilter filter : filters )
             {
                 addScopesfilter.getScopes() );
             }
         }
     }
 
     private void addScopesCollection<Stringscopes )
     {
         if ( scopes != null )
         {
             for ( String scope : scopes )
             {
                 addScopescope );
             }
         }
     }
 
     private void addScopeString scope )
     {
         this..addscope );
 
         addScopeInternalscope );
     }
 
     public Set<StringgetScopes()
     {
         return ;
     }
 
     @Override
     public int hashCode()
     {
         int hash = 17;
 
         hash = hash * 31 + .hashCode();
        return hash;
    }
    @Override
    public boolean equalsObject obj )
    {
        if ( this == obj )
        {
            return true;
        }
        if ( !( obj instanceof CumulativeScopeArtifactFilter ) )
        {
            return false;
        }
        return .equalsthat.scopes );
    }
New to GrepCode? Check out our FAQ X