Package org.apache.rat.license
Class LicenseSetFactory
java.lang.Object
org.apache.rat.license.LicenseSetFactory
Class to take a set of ILicenses and collection of approved license categories and extract Subsets.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
An enum that defines the types of Licenses to extract. -
Constructor Summary
ConstructorDescriptionLicenseSetFactory(SortedSet<ILicense> licenses, Collection<String> approvedLicenses)
Constructs a factory with the specified set of Licenses and the approved license collection. -
Method Summary
Modifier and TypeMethodDescriptionCreate an empty sorted Set with proper comparator.Gets the LicenseFamily objects based on the filter.Gets the categories of LicenseFamily objects based on the filter.Gets the License objects based on the filter.static ILicense
Search a SortedSet of licenses for the matching license id.static ILicense
Search a SortedSet of licenses for the matching license.
-
Constructor Details
-
LicenseSetFactory
Constructs a factory with the specified set of Licenses and the approved license collection.- Parameters:
licenses
- the set of defined licenses.approvedLicenses
- the list of approved licenses.
-
-
Method Details
-
emptyLicenseSet
Create an empty sorted Set with proper comparator.- Returns:
- An empty sorted set of ILicense objects.
-
getLicenses
Gets the License objects based on the filter.- Parameters:
filter
- the types of LicenseFamily objects to return.- Returns:
- a SortedSet of ILicense objects.
-
getLicenseFamilies
Gets the LicenseFamily objects based on the filter.- Parameters:
filter
- the types of LicenseFamily objects to return.- Returns:
- a SortedSet of ILicenseFamily objects.
-
getLicenseFamilyIds
Gets the categories of LicenseFamily objects based on the filter.- Parameters:
filter
- the types of LicenseFamily objects to return.- Returns:
- a SortedSet of ILicenseFamily categories.
-
search
Search a SortedSet of licenses for the matching license id.- Parameters:
licenseId
- the id to search for.licenses
- the SortedSet of licenses to search.- Returns:
- the matching license or
null
if not found.
-
search
Search a SortedSet of licenses for the matching license.- Parameters:
target
- the license to search for.licenses
- the SortedSet of licenses to search.- Returns:
- the matching license or
null
if not found.
-