Package org.codehaus.mojo.license.model
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>>
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.LicenseMap
(Comparator<org.apache.maven.project.MavenProject> projectComparator) -
Method Summary
Modifier and TypeMethodDescriptionSortedSet
<org.apache.maven.project.MavenProject> Store in the license map a project to a given license.void
putAll
(LicenseMap licenseMap) Store in the license other licenseMap.removeProject
(org.apache.maven.project.MavenProject project) Remove project from all licenses it is mapped to.Build a dependencies map from the license map, this is a map of license for each project registered in the license map.Methods inherited from class java.util.TreeMap
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, isEmpty, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, getOrDefault, hashCode, isEmpty, merge, putIfAbsent, remove
-
Field Details
-
UNKNOWN_LICENSE_MESSAGE
- See Also:
-
-
Constructor Details
-
LicenseMap
public LicenseMap()Default constructor. -
LicenseMap
-
-
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 projectvalue
- project to register in the license map- Returns:
- the set of projects using the given license
-
putAll
Store in the license other licenseMap.- Parameters:
licenseMap
- license map to put
-
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
-
removeProject
Remove project from all licenses it is mapped to.- Parameters:
project
-- Returns:
- a List of license names that the given project was mapped to
-