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