Coverage Report - org.apache.maven.plugins.enforcer.utils.PluginWrapper
 
Classes in this File Line Coverage Branch Coverage Complexity
PluginWrapper
0%
0/33
0%
0/8
1.364
 
 1  
 package org.apache.maven.plugins.enforcer.utils;
 2  
 
 3  
 /*
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  *  http://www.apache.org/licenses/LICENSE-2.0
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 20  
  */
 21  
 
 22  
 import java.util.ArrayList;
 23  
 import java.util.List;
 24  
 
 25  
 import org.apache.maven.model.Plugin;
 26  
 import org.apache.maven.model.ReportPlugin;
 27  
 
 28  
 public class PluginWrapper
 29  
 {
 30  
     private String groupId;
 31  
 
 32  
     private String artifactId;
 33  
 
 34  
     private String version;
 35  
 
 36  
     private String source;
 37  
 
 38  
     public static List<PluginWrapper> addAll( List<?> plugins, String source )
 39  
     {
 40  0
         List<PluginWrapper> results = null;
 41  
 
 42  0
         if ( !plugins.isEmpty() )
 43  
         {
 44  0
             results = new ArrayList<PluginWrapper>( plugins.size() );
 45  0
             for ( Object o : plugins )
 46  
             {
 47  0
                 if ( o instanceof Plugin )
 48  
                 {
 49  0
                     results.add( new PluginWrapper( (Plugin) o, source ) );
 50  
                 }
 51  
                 else
 52  
                 {
 53  0
                     if ( o instanceof ReportPlugin )
 54  
                     {
 55  0
                         results.add( new PluginWrapper( (ReportPlugin) o, source ) );
 56  
                     }
 57  
                 }
 58  
 
 59  
             }
 60  
         }
 61  0
         return results;
 62  
     }
 63  
 
 64  
     public PluginWrapper( Plugin plugin, String source )
 65  0
     {
 66  0
         setGroupId( plugin.getGroupId() );
 67  0
         setArtifactId( plugin.getArtifactId() );
 68  0
         setVersion( plugin.getVersion() );
 69  0
         setSource( source );
 70  0
     }
 71  
 
 72  
     public PluginWrapper( ReportPlugin plugin, String source )
 73  0
     {
 74  0
         setGroupId( plugin.getGroupId() );
 75  0
         setArtifactId( plugin.getArtifactId() );
 76  0
         setVersion( plugin.getVersion() );
 77  0
         setSource( source );
 78  0
     }
 79  
 
 80  
     public String getGroupId()
 81  
     {
 82  0
         return groupId;
 83  
     }
 84  
 
 85  
     public void setGroupId( String groupId )
 86  
     {
 87  0
         this.groupId = groupId;
 88  0
     }
 89  
 
 90  
     public String getArtifactId()
 91  
     {
 92  0
         return artifactId;
 93  
     }
 94  
 
 95  
     public void setArtifactId( String artifactId )
 96  
     {
 97  0
         this.artifactId = artifactId;
 98  0
     }
 99  
 
 100  
     public String getVersion()
 101  
     {
 102  0
         return version;
 103  
     }
 104  
 
 105  
     public void setVersion( String version )
 106  
     {
 107  0
         this.version = version;
 108  0
     }
 109  
 
 110  
     public String getSource()
 111  
     {
 112  0
         return source;
 113  
     }
 114  
 
 115  
     public void setSource( String source )
 116  
     {
 117  0
         this.source = source;
 118  0
     }
 119  
 }