Package io.confluent.license
Class LicenseSelectionStrategy
java.lang.Object
io.confluent.license.LicenseSelectionStrategy
A strategy class that accepts a lambda function to select a license from a list of licenses.
If no custom selection function is provided, it uses the default longest expiry strategy.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new LicenseSelectionStrategy with the default longest expiry strategy.LicenseSelectionStrategy(Function<List<License>, License> selectionFunction) Creates a new LicenseSelectionStrategy with the provided selection function. -
Method Summary
Modifier and TypeMethodDescriptionselectLicense(List<License> licenses) Selects a license from the provided list using the configured selection function.
-
Constructor Details
-
LicenseSelectionStrategy
public LicenseSelectionStrategy()Creates a new LicenseSelectionStrategy with the default longest expiry strategy. -
LicenseSelectionStrategy
Creates a new LicenseSelectionStrategy with the provided selection function.- Parameters:
selectionFunction- a function that takes a list of licenses and returns one license
-
-
Method Details
-
selectLicense
Selects a license from the provided list using the configured selection function.- Parameters:
licenses- the list of licenses to choose from; may be null or empty- Returns:
- the selected license, or null if no license can be selected
-