LogLevel.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.cast_de_nrw_schule_svws_logger_LogLevel = exports.LogLevel = void 0;
  4. const JavaObject_1 = require("../java/lang/JavaObject");
  5. class LogLevel extends JavaObject_1.JavaObject {
  6. /** the name of the enumeration value */
  7. __name;
  8. /** the ordinal value for the enumeration value */
  9. __ordinal;
  10. /** an array containing all values of this enumeration */
  11. static all_values_by_ordinal = [];
  12. /** an array containing all values of this enumeration indexed by their name*/
  13. static all_values_by_name = new Map();
  14. static APP = new LogLevel("APP", 0, 0);
  15. static ERROR = new LogLevel("ERROR", 1, 10);
  16. static WARNING = new LogLevel("WARNING", 2, 100);
  17. static INFO = new LogLevel("INFO", 3, 1000);
  18. static DEBUG = new LogLevel("DEBUG", 4, 10000);
  19. level;
  20. /**
  21. * Der von der Ausfzählung intern genutzte Konstruktor der Aufzählung
  22. *
  23. * @param level der Integer-Wert des Log-Levels.
  24. */
  25. constructor(name, ordinal, level) {
  26. super();
  27. this.__name = name;
  28. this.__ordinal = ordinal;
  29. LogLevel.all_values_by_ordinal.push(this);
  30. LogLevel.all_values_by_name.set(name, this);
  31. this.level = level;
  32. }
  33. /**
  34. * Gibt den Integer-Wert des Log-Levels zurück.
  35. *
  36. * @return der Integer-Wert des Log-Levels
  37. */
  38. toInteger() {
  39. return this.level;
  40. }
  41. /**
  42. * Returns the name of this enumeration value.
  43. *
  44. * @returns the name
  45. */
  46. name() {
  47. return this.__name;
  48. }
  49. /**
  50. * Returns the ordinal value of this enumeration value.
  51. *
  52. * @returns the ordinal value
  53. */
  54. ordinal() {
  55. return this.__ordinal;
  56. }
  57. /**
  58. * Returns the name of this enumeration value.
  59. *
  60. * @returns the name
  61. */
  62. toString() {
  63. return this.__name;
  64. }
  65. /**
  66. * Returns true if this and the other enumeration values are equal.
  67. *
  68. * @param other the other enumeration value
  69. *
  70. * @returns true if they are equal and false otherwise
  71. */
  72. equals(other) {
  73. if (!(other instanceof LogLevel))
  74. return false;
  75. return this === other;
  76. }
  77. /**
  78. * Returns the ordinal value as hashcode, since the ordinal value is unique.
  79. *
  80. * @returns the ordinal value as hashcode
  81. */
  82. hashCode() {
  83. return this.__ordinal;
  84. }
  85. /**
  86. * Compares this enumeration value with the other enumeration value by their ordinal value.
  87. *
  88. * @param other the other enumeration value
  89. *
  90. * @returns a negative, zero or postive value as this enumeration value is less than, equal to
  91. * or greater than the other enumeration value
  92. */
  93. compareTo(other) {
  94. return this.__ordinal - other.__ordinal;
  95. }
  96. /**
  97. * Returns an array with enumeration values.
  98. *
  99. * @returns the array with enumeration values
  100. */
  101. static values() {
  102. return [...this.all_values_by_ordinal];
  103. }
  104. /**
  105. * Returns the enumeration value with the specified name.
  106. *
  107. * @param name the name of the enumeration value
  108. *
  109. * @returns the enumeration values or null
  110. */
  111. static valueOf(name) {
  112. let tmp = this.all_values_by_name.get(name);
  113. return (!tmp) ? null : tmp;
  114. }
  115. isTranspiledInstanceOf(name) {
  116. return ['de.nrw.schule.svws.logger.LogLevel'].includes(name);
  117. }
  118. }
  119. exports.LogLevel = LogLevel;
  120. function cast_de_nrw_schule_svws_logger_LogLevel(obj) {
  121. return obj;
  122. }
  123. exports.cast_de_nrw_schule_svws_logger_LogLevel = cast_de_nrw_schule_svws_logger_LogLevel;
  124. //# sourceMappingURL=LogLevel.js.map