use of org.mule.runtime.extension.api.annotation.license.RequiresEnterpriseLicense in project mule by mulesoft.
the class DefaultJavaModelLoaderDelegate method processLicenseRequirements.
private void processLicenseRequirements(ExtensionDeclarer declarer) {
Optional<RequiresEntitlement> requiresEntitlementOptional = extensionElement.getAnnotation(RequiresEntitlement.class);
Optional<RequiresEnterpriseLicense> requiresEnterpriseLicenseOptional = extensionElement.getAnnotation(RequiresEnterpriseLicense.class);
boolean requiresEnterpriseLicense = requiresEnterpriseLicenseOptional.isPresent();
boolean allowsEvaluationLicense = requiresEnterpriseLicenseOptional.map(RequiresEnterpriseLicense::allowEvaluationLicense).orElse(true);
Optional<String> requiredEntitlement = requiresEntitlementOptional.map(RequiresEntitlement::name);
declarer.withModelProperty(new LicenseModelProperty(requiresEnterpriseLicense, allowsEvaluationLicense, requiredEntitlement));
}
Aggregations