Class LicenseMap

java.lang.Object
java.util.AbstractMap<String,SortedSet<org.apache.maven.project.MavenProject>>
java.util.TreeMap<String,SortedSet<org.apache.maven.project.MavenProject>>
org.codehaus.mojo.license.model.LicenseMap
All Implemented Interfaces:
Serializable, Cloneable, Map<String,SortedSet<org.apache.maven.project.MavenProject>>, NavigableMap<String,SortedSet<org.apache.maven.project.MavenProject>>, SortedMap<String,SortedSet<org.apache.maven.project.MavenProject>>

public class LicenseMap extends TreeMap<String,SortedSet<org.apache.maven.project.MavenProject>>
Map of artifacts (stub in mavenproject) grouped by their license.
  • key is the license on which to associate the given project.
  • value list of projects belonging to the license.
Since:
1.0
Author:
tchemit dev@tchemit.fr
See Also:
  • Field Details

  • Constructor Details

    • LicenseMap

      public LicenseMap()
      Default constructor.
    • LicenseMap

      public LicenseMap(Comparator<org.apache.maven.project.MavenProject> projectComparator)
  • Method Details

    • put

      public SortedSet<org.apache.maven.project.MavenProject> put(String key, org.apache.maven.project.MavenProject value)
      Store in the license map a project to a given license.
      Parameters:
      key - the license on which to associate the given project
      value - project to register in the license map
      Returns:
      the set of projects using the given license
    • putAll

      public void putAll(LicenseMap licenseMap)
      Store in the license other licenseMap.
      Parameters:
      licenseMap - license map to put
    • toDependencyMap

      public SortedMap<org.apache.maven.project.MavenProject,String[]> toDependencyMap()
      Build a dependencies map from the license map, this is a map of license for each project registered in the license map.
      Returns:
      the generated dependencies map
    • toLicenseMapOrderByName

      public LicenseMap toLicenseMapOrderByName()
    • removeProject

      public List<String> removeProject(org.apache.maven.project.MavenProject project)
      Remove project from all licenses it is mapped to.
      Parameters:
      project -
      Returns:
      a List of license names that the given project was mapped to