Joaquín Reñé
2025-10-07 146a0fb8b0e90f9196e569152f649baf60d6cc8f
securis/src/main/java/net/curisit/securis/db/PackStatus.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,38 +9,58 @@
69 import com.fasterxml.jackson.annotation.JsonValue;
710
811 /**
9
- * Contains the possible pack statuses. For further details:
10
- * https://redmine.curistec.com/projects/securis/wiki/LicensesServerManagement
11
- *
12
- * @author rob
13
- */
12
+* PackStatus
13
+* <p>
14
+* Enumerates possible pack lifecycle statuses. JSON representation is the short code.
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 PackStatus implements CodedEnum {
21
+
22
+ // Available status for the pack
1523 CREATED("CR"), ACTIVE("AC"), ON_HOLD("OH"), EXPIRED("EX"), CANCELLED("CA");
1624
1725 private final String code;
1826
19
- PackStatus(String code) {
20
- this.code = code;
21
- }
27
+ /**
28
+ * PackStatus<p>
29
+ * Constructor
30
+ *
31
+ * @param code
32
+ */
33
+ PackStatus(String code) { this.code = code; }
2234
23
- @Override
24
- public String getCode() {
25
- return code;
26
- }
35
+ /**
36
+ * getCode<p>
37
+ * Short code stored in DB / used in JSON.
38
+ *
39
+ * @return packCode
40
+ */
41
+ @Override public String getCode() { return code; }
2742
43
+ /**
44
+ * valueFromCode<p>
45
+ * Factory method from short code.
46
+ *
47
+ * @param packCode
48
+ * @return packStatus
49
+ */
2850 @JsonCreator
2951 public static PackStatus valueFromCode(String code) {
3052 for (PackStatus ps : PackStatus.values()) {
31
- if (ps.code.equals(code)) {
32
- return ps;
33
- }
53
+ if (ps.code.equals(code)) return ps;
3454 }
3555 return null;
3656 }
3757
58
+ /**
59
+ * getName<p>
60
+ * Expose short code as JSON value.
61
+ *
62
+ * @return name
63
+ */
3864 @JsonValue
39
- public String getName() {
40
- return this.code;
41
- }
42
-
65
+ public String getName() { return this.code; }
4366 }