Class LicenseAuthorizerFactory

java.lang.Object
de.xima.fc.license.LicenseAuthorizerFactory

public class LicenseAuthorizerFactory extends Object
Factory for creating license authorizers.
Since:
8.2.0
Author:
XIMA MEDIA GmbH
  • Method Details

    • 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.
    • feature

      public static ILicenseAuthorizer feature(ELicenseFeature feature, boolean defaultIfNotSet)
      Creates an authorizer that checks if the given feature is authorized.
      Parameters:
      feature - The feature to check.
      defaultIfNotSet - The default value if the feature is not set.
      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.