Class LicenseFamilySetFactory

java.lang.Object
org.apache.rat.license.LicenseFamilySetFactory

public class LicenseFamilySetFactory extends Object
Class to take a set of ILicenses and collection of approved license categories and extract Subsets.
  • 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

      public static SortedSet<ILicenseFamily> emptyLicenseFamilySet()
      Create an empty sorted Set with proper comparator.
      Returns:
      An empty sorted set of ILicenseFamily objects.
    • getFamilies

      public SortedSet<ILicenseFamily> getFamilies(LicenseSetFactory.LicenseFilter filter)
      Gets the License objects based on the filter.
      Parameters:
      filter - the types of LicenseFamily objects to return.
      Returns:
      a SortedSet of ILicense objects.
    • getFamilyIds

      public SortedSet<String> getFamilyIds(LicenseSetFactory.LicenseFilter filter)
      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

      public static ILicenseFamily search(String 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.
    • 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.