/* * 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 *

* 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

* Constructor * * @param code */ LicenseStatus(String code) { this.code = code; } /** * getCode

* Return the short code used in DB/JSON. * * @return code */ @Override public String getCode() { return code; } /** * valueFromCode

* 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

* Expose the code as JSON value. * * @return name */ @JsonValue public String getName() { return this.code; } /** * toString

* Get the string describing the current object * * @return object string */ @Override public String toString() { return code; } }