Class LicenseManager
java.lang.Object
ch.nolix.base.environment.license.LicenseManager
Of the
LicenseManager an instance cannot be created.- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddLicense(License license) Adds the given license to theLicenseManager.static <L extends License>
voidaddLicense(Class<L> licenseType) Creates and adds a newLicenseof the given licenseType to theLicenseManager.static voidremoveLicense(License license) Removes the given license from theLicenseManager.static <F extends AbstractFeature>
voidrequireFeature(Class<F> featureType) Requires theLicenseManagerto contain aAbstractFeatureof the given featureType.static LongMediatorwhen(long value)
-
Method Details
-
addLicense
Adds the given license to theLicenseManager.- Parameters:
license-- Throws:
RuntimeException- if the given license is null.RuntimeException- if theLicenseManagercontains already aLicenseof the type the given license is.
-
addLicense
Creates and adds a newLicenseof the given licenseType to theLicenseManager.- Type Parameters:
L- is the given licenseType.- Parameters:
licenseType-- Throws:
RuntimeException- if the given licenseType is null.RuntimeException- if if there was not found a file with the key for a License of the given licenseType.RuntimeException- if the given licenseType does not contain a constructor with 1Stringparameter.RuntimeException- if the found key is not valid.RuntimeException- if theLicenseManagercontains already aLicenseof the given licenseType.
-
requireFeature
Requires theLicenseManagerto contain aAbstractFeatureof the given featureType.- Type Parameters:
F- is the given featureType.- Parameters:
featureType-- Throws:
ArgumentDoesNotHaveAttributeException- if theLicenseManagerdoes not contain aAbstractFeatureof the given featureType.
-
removeLicense
Removes the given license from theLicenseManager.- Parameters:
license-- Throws:
RuntimeException- if theLicenseManagerdoes not contain the given license.
-
when
- Parameters:
value-- Returns:
- a new
LongMediatorfor the given value.
-