Class PolymartLicenseChecker

java.lang.Object
me.hsgamer.hscore.license.polymart.PolymartLicenseChecker
All Implemented Interfaces:
LicenseChecker

public class PolymartLicenseChecker extends Object implements LicenseChecker
The license checker for Polymart
  • Constructor Details

    • PolymartLicenseChecker

      public PolymartLicenseChecker(String resource, boolean isPaid, boolean isDeepCheck, PolymartLicenseFetcher fetcher)
      Create a new license checker
      Parameters:
      resource - the resource id
      isPaid - whether the resource is paid
      isDeepCheck - whether the checker should check the license deeply using Polymart API
      fetcher - the license fetcher
    • PolymartLicenseChecker

      public PolymartLicenseChecker(String resource, boolean isPaid, boolean isDeepCheck)
      Create a new license checker with the default fetcher
      Parameters:
      resource - the resource id
      isPaid - whether the resource is paid
      isDeepCheck - whether the checker should check the license deeply using Polymart API
  • Method Details

    • isAvailable

      public static boolean isAvailable(String identifier)
      Check whether the checker can be used
      Parameters:
      identifier - the identifier
      Returns:
      true if it can be used
    • isAvailable

      public static boolean isAvailable()
      Check whether the checker can be used
      Returns:
      true if it can be used
    • setExceptionHandler

      public PolymartLicenseChecker setExceptionHandler(Consumer<Throwable> exceptionHandler)
      Set the exception handler
      Parameters:
      exceptionHandler - the exception handler
    • checkLicense

      public LicenseResult checkLicense()
      Description copied from interface: LicenseChecker
      Check the license
      Specified by:
      checkLicense in interface LicenseChecker
      Returns:
      the result