UNPKG

@softvision/webpdf-wsclient-typescript

Version:

A simplified and optimized API client library for the webPDF server

104 lines 4.72 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.JavaStatus = void 0; const index_1 = require("./../index"); class JavaStatus { constructor(data) { this.gc = (data.gc || []).map(index_1.JavaStatusGC.fromJson); let javaNameDefault = ""; this.javaName = typeof (data === null || data === void 0 ? void 0 : data.javaName) !== "undefined" ? data === null || data === void 0 ? void 0 : data.javaName : javaNameDefault; let javaVendorDefault = ""; this.javaVendor = typeof (data === null || data === void 0 ? void 0 : data.javaVendor) !== "undefined" ? data === null || data === void 0 ? void 0 : data.javaVendor : javaVendorDefault; let javaVersionDefault = ""; this.javaVersion = typeof (data === null || data === void 0 ? void 0 : data.javaVersion) !== "undefined" ? data === null || data === void 0 ? void 0 : data.javaVersion : javaVersionDefault; let memoryAllocatedDefault = 0; this.memoryAllocated = typeof (data === null || data === void 0 ? void 0 : data.memoryAllocated) !== "undefined" ? data === null || data === void 0 ? void 0 : data.memoryAllocated : memoryAllocatedDefault; let memoryFreeDefault = 0; this.memoryFree = typeof (data === null || data === void 0 ? void 0 : data.memoryFree) !== "undefined" ? data === null || data === void 0 ? void 0 : data.memoryFree : memoryFreeDefault; let memoryMaxDefault = 0; this.memoryMax = typeof (data === null || data === void 0 ? void 0 : data.memoryMax) !== "undefined" ? data === null || data === void 0 ? void 0 : data.memoryMax : memoryMaxDefault; let memoryTotalFreeDefault = 0; this.memoryTotalFree = typeof (data === null || data === void 0 ? void 0 : data.memoryTotalFree) !== "undefined" ? data === null || data === void 0 ? void 0 : data.memoryTotalFree : memoryTotalFreeDefault; let memoryUsedDefault = 0; this.memoryUsed = typeof (data === null || data === void 0 ? void 0 : data.memoryUsed) !== "undefined" ? data === null || data === void 0 ? void 0 : data.memoryUsed : memoryUsedDefault; } static getGcDefault() { return []; } static getGcDescription() { return "The list of GC used and their execution values."; } static getJavaNameDefault() { return ""; } static getJavaNameDescription() { return "The name of the running JVM."; } static getJavaVendorDefault() { return ""; } static getJavaVendorDescription() { return "The vendor of the running JVM."; } static getJavaVersionDefault() { return ""; } static getJavaVersionDescription() { return "The java version of the running JVM."; } static getMemoryAllocatedDefault() { return 0; } static getMemoryAllocatedDescription() { return "The byte size of the memory currently allocated for the running JVM."; } static getMemoryFreeDefault() { return 0; } static getMemoryFreeDescription() { return "The byte size of free memory, that currently is available for further object allocations."; } static getMemoryMaxDefault() { return 0; } static getMemoryMaxDescription() { return "The byte size of the maximum memory, that could be allocated by the JVM, if required."; } static getMemoryTotalFreeDefault() { return 0; } static getMemoryTotalFreeDescription() { return "The byte size of the free memory, that would currently be available for further object allocations, if the JVM would allocate the maximum allowed memory size."; } static getMemoryUsedDefault() { return 0; } static getMemoryUsedDescription() { return "The byte size of the allocated memory, that is actually used by the JVM at the moment."; } static fromJson(data) { if (data === undefined || data === null) { return data; } return new JavaStatus(data); } toJson() { var _a; return { 'gc': (_a = this.gc) === null || _a === void 0 ? void 0 : _a.map((data) => data.toJson()), 'javaName': this.javaName, 'javaVendor': this.javaVendor, 'javaVersion': this.javaVersion, 'memoryAllocated': this.memoryAllocated, 'memoryFree': this.memoryFree, 'memoryMax': this.memoryMax, 'memoryTotalFree': this.memoryTotalFree, 'memoryUsed': this.memoryUsed, }; } clone() { return JavaStatus.fromJson(this.toJson()); } } exports.JavaStatus = JavaStatus; //# sourceMappingURL=JavaStatus.js.map