Class PolymartLicenseChecker
java.lang.Object
me.hsgamer.hscore.license.polymart.PolymartLicenseChecker
- All Implemented Interfaces:
LicenseChecker
The license checker for Polymart
-
Constructor Summary
ConstructorDescriptionPolymartLicenseChecker
(String resource, boolean isPaid, boolean isDeepCheck) Create a new license checker with the default fetcherPolymartLicenseChecker
(String resource, boolean isPaid, boolean isDeepCheck, PolymartLicenseFetcher fetcher) Create a new license checker -
Method Summary
Modifier and TypeMethodDescriptionCheck the licensestatic boolean
Check whether the checker can be usedstatic boolean
isAvailable
(String identifier) Check whether the checker can be usedsetExceptionHandler
(Consumer<Throwable> exceptionHandler) Set the exception handler
-
Constructor Details
-
PolymartLicenseChecker
public PolymartLicenseChecker(String resource, boolean isPaid, boolean isDeepCheck, PolymartLicenseFetcher fetcher) Create a new license checker- Parameters:
resource
- the resource idisPaid
- whether the resource is paidisDeepCheck
- whether the checker should check the license deeply using Polymart APIfetcher
- the license fetcher
-
PolymartLicenseChecker
Create a new license checker with the default fetcher- Parameters:
resource
- the resource idisPaid
- whether the resource is paidisDeepCheck
- whether the checker should check the license deeply using Polymart API
-
-
Method Details
-
isAvailable
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
Set the exception handler- Parameters:
exceptionHandler
- the exception handler
-
checkLicense
Description copied from interface:LicenseChecker
Check the license- Specified by:
checkLicense
in interfaceLicenseChecker
- Returns:
- the result
-