From 8326e3b92c243549b26a8b36c1ae26d563576828 Mon Sep 17 00:00:00 2001 From: Braydon Date: Thu, 1 Jun 2023 00:33:37 -0400 Subject: [PATCH] oops --- .../main/java/me/braydon/example/Main.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Example/src/main/java/me/braydon/example/Main.java diff --git a/Example/src/main/java/me/braydon/example/Main.java b/Example/src/main/java/me/braydon/example/Main.java new file mode 100644 index 0000000..019ae25 --- /dev/null +++ b/Example/src/main/java/me/braydon/example/Main.java @@ -0,0 +1,30 @@ +package me.braydon.example; + +import java.util.concurrent.TimeUnit; + +/** + * @author Braydon + */ +public final class Main { + public static void main(String[] args) { + LicenseExample.LicenseResponse response = LicenseExample.check("XXXX-XXXX-XXXX-XXXX", "Example"); + if (!response.isValid()) { // License isn't valid + System.err.println("Invalid license: " + response.getError()); + return; + } + // License is valid + System.out.println("License is valid!"); + if (response.getOwnerName() != null) { + System.out.println("Welcome " + response.getOwnerName() + "!"); + } + if (response.getDescription() != null) { + System.out.println("Description: " + response.getDescription()); // License description + } + if (response.isPermanent()) { // License is permanent + System.out.println("Your license is permanent"); + } else { // License has a duration + long durationSeconds = TimeUnit.SECONDS.toMillis(response.getDuration()); // The duration in seconds + System.out.println("Your license will expire in " + durationSeconds + " seconds"); + } + } +} \ No newline at end of file