Class LicenseManagerUnit
java.lang.Object
ch.nolix.base.environment.license.LicenseManagerUnit
A
LicenseManagerUnit contains Licenses.- Author:
- Silvan Wyss
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLicense(License license) Adds the given license to the currentLicenseManagerUnit.<L extends License>
LicenseManagerUnitaddLicense(Class<L> licenseType) Creates and adds a newLicenseof the given licenseType to the currentLicenseManagerUnit<F extends AbstractFeature>
booleancontainsFeature(Class<F> featureType) <L extends License>
booleancontainsLicense(Class<L> licenseType) IContainer<Class<?>> voidremoveLicense(License license) Removes the given license from the currentLicenseManagerUnit.<F extends AbstractFeature>
LicenseManagerUnitrequireFeature(Class<F> featureType) Requires the currentLicenseManagerUnitto contain aAbstractFeatureof the given featureType.when(long value)
-
Constructor Details
-
LicenseManagerUnit
public LicenseManagerUnit()
-
-
Method Details
-
addLicense
Creates and adds a newLicenseof the given licenseType to the currentLicenseManagerUnit- Type Parameters:
L- is the given licenseType.- Parameters:
licenseType-- Returns:
- the current
LicenseManagerUnit. - 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 the currentLicenseManagerUnitdoes contain already aLicenseof the given licenseType.
-
addLicense
Adds the given license to the currentLicenseManagerUnit.- Parameters:
license-- Returns:
- the current
LicenseManagerUnit. - Throws:
RuntimeException- if the given license is null.RuntimeException- if the given license is not activated.RuntimeException- if the currentLicenseManagerUnitcontains already aLicenseof the type the given license is.
-
containsFeature
- Type Parameters:
F- is the given featureType.- Parameters:
featureType-- Returns:
- true if the current
LicenseManagerUnitcontains aAbstractFeatureof the given featureType, false otherwise.
-
containsLicense
- Type Parameters:
L- is the given licenseType.- Parameters:
licenseType-- Returns:
- true if the current
LicenseManagerUnitcontains aLicenseof the given licenseType, false otherwise.
-
getLicenseTypes
- Returns:
- the types of the licenses of the current
LicenseManagerUnit.
-
removeLicense
Removes the given license from the currentLicenseManagerUnit.- Parameters:
license-- Throws:
ArgumentDoesNotContainElementException- if the currentLicenseManagerUnitdoes not contain the given license.
-
requireFeature
Requires the currentLicenseManagerUnitto contain aAbstractFeatureof the given featureType.- Type Parameters:
F- is the given featureType.- Parameters:
featureType-- Returns:
- the current
LicenseManagerUnit. - Throws:
ArgumentDoesNotHaveAttributeException- if the currentLicenseManagerUnitdoes not contain aAbstractFeatureof the given featureType.
-
when
- Parameters:
value-- Returns:
- a new
LongMediatorfor the given value.
-