Class LicenseManagerUnit
java.lang.Object
ch.nolix.base.environment.license.LicenseManagerUnit
A
LicenseManagerUnit contains AbstractLicenses.- Author:
- Silvan Wyss
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLicense(AbstractLicense abstractLicense) Adds the given license to the currentLicenseManagerUnit.<L extends AbstractLicense>
LicenseManagerUnitaddLicense(Class<L> licenseType) Creates and adds a newAbstractLicenseof the given licenseType to the currentLicenseManagerUnit<F extends AbstractFeature>
booleancontainsFeature(Class<F> featureType) <L extends AbstractLicense>
booleancontainsLicense(Class<L> licenseType) voidremoveLicense(AbstractLicense abstractLicense) 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 newAbstractLicenseof 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 nullRuntimeException- if if there was not found a file with the key for a License of the given licenseTypeRuntimeException- if the given licenseType does not contain a constructor with 1StringparameterRuntimeException- if the found key is not validRuntimeException- if the currentLicenseManagerUnitdoes contain already aAbstractLicenseof the given licenseType.
-
addLicense
Adds the given license to the currentLicenseManagerUnit.- Parameters:
abstractLicense-- Returns:
- the current
LicenseManagerUnit - Throws:
RuntimeException- if the given license is nullRuntimeException- if the given license is not activatedRuntimeException- if the currentLicenseManagerUnitcontains already aAbstractLicenseof 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 aAbstractLicenseof 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:
abstractLicense-- 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.
-