Package org.apache.rat.license
Class LicenseFamilySetFactory
java.lang.Object
org.apache.rat.license.LicenseFamilySetFactory
Class to take a set of ILicenses and collection of approved license categories and extract Subsets.
-
Constructor Summary
ConstructorDescriptionLicenseFamilySetFactory(SortedSet<ILicenseFamily> licenses, Collection<String> approvedLicenses)
Constructs a factory with the specified set of Licenses and the approved license collection. -
Method Summary
Modifier and TypeMethodDescriptionstatic SortedSet<ILicenseFamily>
Create an empty sorted Set with proper comparator.Gets the License objects based on the filter.Gets the categories of LicenseFamily objects based on the filter.static ILicenseFamily
search(String target, SortedSet<ILicenseFamily> licenseFamilies)
Search a SortedSet of ILicenseFamily instances looking for a matching instance.static ILicenseFamily
search(ILicenseFamily target, SortedSet<ILicenseFamily> licenseFamilies)
Search a SortedSet of ILicenseFamily instances looking for a matching instance.
-
Constructor Details
-
LicenseFamilySetFactory
public LicenseFamilySetFactory(SortedSet<ILicenseFamily> licenses, Collection<String> approvedLicenses)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
-
emptyLicenseFamilySet
Create an empty sorted Set with proper comparator.- Returns:
- An empty sorted set of ILicenseFamily objects.
-
getFamilies
Gets the License objects based on the filter.- Parameters:
filter
- the types of LicenseFamily objects to return.- Returns:
- a SortedSet of ILicense objects.
-
getFamilyIds
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 ILicenseFamily instances looking for a matching instance.- Parameters:
target
- The instance to search for.licenseFamilies
- the license families to search- Returns:
- the matching instance of the target given.
-
search
public static ILicenseFamily search(ILicenseFamily target, SortedSet<ILicenseFamily> licenseFamilies)Search a SortedSet of ILicenseFamily instances looking for a matching instance.- Parameters:
target
- The instance to search for.licenseFamilies
- the license families to search- Returns:
- the matching instance of the target given.
-