Class LicenseClassifications
-
- All Implemented Interfaces:
public final class LicenseClassificationsClassifications for licenses which allow assigning metadata to licenses. This allows defining rather generic categories and assigning licenses to these. That way flexible classifications can be created based on customizable categories. The available license categories need to be declared explicitly; when creating an instance, it is checked that all the references from the categorizations point to existing categories.
-
-
Field Summary
Fields Modifier and Type Field Description private final Map<String, Set<SpdxSingleLicenseExpression>>licensesByCategoryprivate final Map<SpdxSingleLicenseExpression, Set<String>>categoriesByLicenseprivate final Set<String>categoryNamesprivate final List<LicenseCategory>categoriesprivate final List<LicenseCategorization>categorizations
-
Constructor Summary
Constructors Constructor Description LicenseClassifications(List<LicenseCategory> categories, List<LicenseCategorization> categorizations)
-
Method Summary
Modifier and Type Method Description final Map<String, Set<SpdxSingleLicenseExpression>>getLicensesByCategory()A property for fast look-ups of licenses for a given category. final Map<SpdxSingleLicenseExpression, Set<String>>getCategoriesByLicense()A property for fast look-ups of categories for a given license. final Set<String>getCategoryNames()A property allowing convenient access to the names of all categories defined in alphabetical order. final List<LicenseCategory>getCategories()Defines metadata for the license categories. final List<LicenseCategorization>getCategorizations()Defines metadata for licenses. final Set<String>get(SpdxExpression id)A convenience operator to return the categories for the given license id, or null if the license is not categorized. final BooleanisCategorized(SpdxExpression id)A convenience function to check whether there is a categorization for the given license id. final LicenseClassificationsmerge(LicenseClassifications other)Merge other into these classifications, overwriting any conflicting existing classifications. -
-
Constructor Detail
-
LicenseClassifications
LicenseClassifications(List<LicenseCategory> categories, List<LicenseCategorization> categorizations)
-
-
Method Detail
-
getLicensesByCategory
final Map<String, Set<SpdxSingleLicenseExpression>> getLicensesByCategory()
A property for fast look-ups of licenses for a given category.
-
getCategoriesByLicense
final Map<SpdxSingleLicenseExpression, Set<String>> getCategoriesByLicense()
A property for fast look-ups of categories for a given license.
-
getCategoryNames
final Set<String> getCategoryNames()
A property allowing convenient access to the names of all categories defined in alphabetical order.
-
getCategories
final List<LicenseCategory> getCategories()
Defines metadata for the license categories.
-
getCategorizations
final List<LicenseCategorization> getCategorizations()
Defines metadata for licenses.
-
get
final Set<String> get(SpdxExpression id)
A convenience operator to return the categories for the given license id, or null if the license is not categorized.
-
isCategorized
final Boolean isCategorized(SpdxExpression id)
A convenience function to check whether there is a categorization for the given license id.
-
merge
final LicenseClassifications merge(LicenseClassifications other)
Merge other into these classifications, overwriting any conflicting existing classifications.
-
-
-
-