Package de.xima.fc.license
Class LicenseAuthorizerFactory
- java.lang.Object
-
- de.xima.fc.license.LicenseAuthorizerFactory
-
public class LicenseAuthorizerFactory extends Object
Factory for creatinglicense authorizers
.- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ILicenseAuthorizer
and(ILicenseAuthorizer... authorizers)
Creates an authorizer that checks if all given authorizers are authorized.static ILicenseAuthorizer
and(ELicenseFeature... features)
Creates an authorizer that checks if all given features are authorized.static ILicenseAuthorizer
feature(ELicenseFeature feature)
Creates an authorizer that checks if the given feature is authorized.static ILicenseAuthorizer
fromString(String authorizer)
Creates a license authorizer from the given serialized representation of the authorizer.static ILicenseAuthorizer
not(ILicenseAuthorizer authorizer)
Creates the negation of the given authorizer.static ILicenseAuthorizer
or(ILicenseAuthorizer... authorizers)
Creates an authorizer that checks if any of the given authorizers are authorized.static ILicenseAuthorizer
or(ELicenseFeature... features)
Creates an authorizer that checks if any of the given features are authorized.
-
-
-
Method Detail
-
and
public static ILicenseAuthorizer and(ILicenseAuthorizer... authorizers)
Creates an authorizer that checks if all given authorizers are authorized.- Parameters:
authorizers
- The authorizers to check.- Returns:
- The new authorizer.
- Throws:
IllegalArgumentException
- If no authorizers are provided.
-
and
public static ILicenseAuthorizer and(ELicenseFeature... features)
Creates an authorizer that checks if all given features are authorized.- Parameters:
features
- The features to check.- Returns:
- The new authorizer.
- Throws:
IllegalArgumentException
- If no features are provided.
-
feature
public static ILicenseAuthorizer feature(ELicenseFeature feature)
Creates an authorizer that checks if the given feature is authorized.- Parameters:
feature
- The feature to check.- Returns:
- The new authorizer.
- Throws:
NullPointerException
- If the feature is null.
-
fromString
public static ILicenseAuthorizer fromString(String authorizer)
Creates a license authorizer from the given serialized representation of the authorizer.- Parameters:
authorizer
- The serialized representation of the authorizer.- Returns:
- The license authorizer.
- Throws:
IllegalArgumentException
- If the authorizer format is unknown or an error occurs while parsing the authorizer.
-
not
public static ILicenseAuthorizer not(ILicenseAuthorizer authorizer)
Creates the negation of the given authorizer.- Parameters:
authorizer
- The authorizer to negate.- Returns:
- The negated authorizer.
- Throws:
NullPointerException
- If the authorizer is null.
-
or
public static ILicenseAuthorizer or(ELicenseFeature... features)
Creates an authorizer that checks if any of the given features are authorized.- Parameters:
features
- The features to check.- Returns:
- The new authorizer.
- Throws:
IllegalArgumentException
- If no features are provided.
-
or
public static ILicenseAuthorizer or(ILicenseAuthorizer... authorizers)
Creates an authorizer that checks if any of the given authorizers are authorized.- Parameters:
authorizers
- The authorizers to check.- Returns:
- The new authorizer.
- Throws:
IllegalArgumentException
- If no authorizers are provided.
-
-