public class LicenseSetFactory extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LicenseSetFactory.LicenseFilter
An enum that defines the types of Licenses to extract.
|
Constructor and Description |
---|
LicenseSetFactory(SortedSet<ILicense> licenses,
Collection<String> approvedLicenses)
Constructs a factory with the specified set of Licenses and the approved
license collection.
|
Modifier and Type | Method and Description |
---|---|
static SortedSet<ILicense> |
emptyLicenseSet()
Create an empty sorted Set with proper comparator.
|
SortedSet<ILicenseFamily> |
getLicenseFamilies(LicenseSetFactory.LicenseFilter filter)
Gets the LicenseFamily objects based on the filter.
|
SortedSet<String> |
getLicenseFamilyIds(LicenseSetFactory.LicenseFilter filter)
Gets the categories of LicenseFamily objects based on the filter.
|
SortedSet<ILicense> |
getLicenses(LicenseSetFactory.LicenseFilter filter)
Gets the License objects based on the filter.
|
static Optional<ILicense> |
search(ILicense target,
SortedSet<ILicense> licenses)
Search a SortedSet of licenses for the matching license.
|
static Optional<ILicense> |
search(String familyId,
String licenseId,
SortedSet<ILicense> licenses)
Search a SortedSet of licenses for the matching license id.
|
public LicenseSetFactory(SortedSet<ILicense> licenses, Collection<String> approvedLicenses)
licenses
- the set of defined licenses.approvedLicenses
- the list of approved licenses.public static SortedSet<ILicense> emptyLicenseSet()
public SortedSet<ILicense> getLicenses(LicenseSetFactory.LicenseFilter filter)
filter
- the types of LicenseFamily objects to return.public SortedSet<ILicenseFamily> getLicenseFamilies(LicenseSetFactory.LicenseFilter filter)
filter
- the types of LicenseFamily objects to return.public SortedSet<String> getLicenseFamilyIds(LicenseSetFactory.LicenseFilter filter)
filter
- the types of LicenseFamily objects to return.public static Optional<ILicense> search(String familyId, String licenseId, SortedSet<ILicense> licenses)
licenseId
- the id to search for.licenses
- the SortedSet of licenses to search.null
if not found.public static Optional<ILicense> search(ILicense target, SortedSet<ILicense> licenses)
target
- the license to search for. Must not be null.licenses
- the SortedSet of licenses to search.null
if not found.Copyright © 2006–2024 Apache Software Foundation. All rights reserved.