Joaquín Reñé
2025-10-07 146a0fb8b0e90f9196e569152f649baf60d6cc8f
securis/src/main/java/net/curisit/securis/db/LicenseStatus.java
....@@ -1,3 +1,6 @@
1
+/*
2
+* Copyright @ 2013 CurisTEC, S.A.S. All Rights Reserved.
3
+*/
14 package net.curisit.securis.db;
25
36 import net.curisit.securis.db.common.CodedEnum;
....@@ -6,42 +9,64 @@
69 import com.fasterxml.jackson.annotation.JsonValue;
710
811 /**
9
- * Contains the possible license statuses. For further details:
10
- * https://redmine.curistec.com/projects/securis/wiki/LicensesServerManagement
11
- *
12
- * @author rob
13
- */
12
+* LicenseStatus
13
+* <p>
14
+* Enumerates the possible license states. JSON code/value is the short code (CR, RE, AC, ...).
15
+* See: https://redmine.curistec.com/projects/securis/wiki/LicensesServerManagement
16
+*
17
+* @author JRA
18
+* Last reviewed by JRA on Oct 5, 2025.
19
+*/
1420 public enum LicenseStatus implements CodedEnum {
1521 CREATED("CR"), REQUESTED("RE"), ACTIVE("AC"), PRE_ACTIVE("PA"), EXPIRED("EX"), CANCELLED("CA"), BLOCKED("BL");
1622
1723 private final String code;
1824
19
- LicenseStatus(String code) {
20
- this.code = code;
21
- }
25
+ /**
26
+ * LicenseStatus<p>
27
+ * Constructor
28
+ *
29
+ * @param code
30
+ */
31
+ LicenseStatus(String code) { this.code = code; }
2232
23
- @Override
24
- public String getCode() {
25
- return code;
26
- }
33
+ /**
34
+ * getCode<p>
35
+ * Return the short code used in DB/JSON.
36
+ *
37
+ * @return code
38
+ */
39
+ @Override public String getCode() { return code; }
2740
41
+ /**
42
+ * valueFromCode<p>
43
+ * Factory from code string (null on unknown).
44
+ *
45
+ * @param code
46
+ */
2847 @JsonCreator
2948 public static LicenseStatus valueFromCode(String code) {
3049 for (LicenseStatus ps : LicenseStatus.values()) {
31
- if (ps.code.equals(code)) {
32
- return ps;
33
- }
50
+ if (ps.code.equals(code)) return ps;
3451 }
3552 return null;
3653 }
3754
55
+ /**
56
+ * getName<p>
57
+ * Expose the code as JSON value.
58
+ *
59
+ * @return name
60
+ */
3861 @JsonValue
39
- public String getName() {
40
- return this.code;
41
- }
62
+ public String getName() { return this.code; }
4263
64
+ /**
65
+ * toString<p>
66
+ * Get the string describing the current object
67
+ *
68
+ * @return object string
69
+ */
4370 @Override
44
- public String toString() {
45
- return code;
46
- }
71
+ public String toString() { return code; }
4772 }