001package Torello.Browser.BrowserAPI; 002 003// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 004// Java-HTML Imports 005// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 006 007import Torello.Browser.*; 008import Torello.Browser.helper.*; 009import Torello.Browser.JavaScriptAPI.*; 010import Torello.JSON.*; 011 012import Torello.Java.ReadOnly.ReadOnlyList; 013import Torello.Java.ReadOnly.ReadOnlyArrayList; 014 015import Torello.JavaDoc.Annotations.StaticFunctional; 016import Torello.JavaDoc.Annotations.JDHeaderBackgroundImg; 017 018import Torello.Browser.BrowserAPI.NestedHelpers.Commands.SystemInfo$$Commands; 019 020 021// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 022// JDK Imports 023// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 024 025import javax.json.JsonObject; 026import javax.json.JsonValue; 027 028/** 029 * <SPAN CLASS=COPIEDJDK><B>The SystemInfo domain defines methods and events for querying low-level system information.</B></SPAN> 030 * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.CODE_GEN_NOTE> 031 */ 032@StaticFunctional@JDHeaderBackgroundImg(EmbedTagFileID="CDP.WOOD_PLANK_NOTE") 033public class SystemInfo 034{ 035 // No Pubic Constructors 036 private SystemInfo() { } 037 038 039 // ******************************************************************************************** 040 // ******************************************************************************************** 041 // Enumerated String Constants Lists 042 // ******************************************************************************************** 043 // ******************************************************************************************** 044 045 046 /** 047 * Image format of a given image. 048 * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B> 049 */ 050 public static final ReadOnlyList<String> ImageType = new ReadOnlyArrayList<> 051 (String.class, "jpeg", "unknown", "webp"); 052 053 /** 054 * YUV subsampling type of the pixels of a given image. 055 * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B> 056 */ 057 public static final ReadOnlyList<String> SubsamplingFormat = new ReadOnlyArrayList<> 058 (String.class, "yuv420", "yuv422", "yuv444"); 059 060 061 062 // ******************************************************************************************** 063 // ******************************************************************************************** 064 // Basic Types 065 // ******************************************************************************************** 066 // ******************************************************************************************** 067 068 069 /** 070 * Describes a single graphics processor (GPU). 071 * 072 * <EMBED CLASS=globalDefs DATA-DOMAIN=SystemInfo DATA-API=BrowserAPI> 073 */ 074 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 075 public static class GPUDevice 076 extends BaseType<GPUDevice> 077 implements java.io.Serializable 078 { 079 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 080 protected static final long serialVersionUID = 1; 081 082 private static final NestedHelper<SystemInfo.GPUDevice> singleton = 083 Torello.Browser.BrowserAPI.NestedHelpers.Types. 084 SystemInfo$$GPUDevice$$.singleton; 085 086 /** PCI ID of the GPU vendor, if available; 0 otherwise. */ 087 public final Number vendorId; 088 089 /** PCI ID of the GPU device, if available; 0 otherwise. */ 090 public final Number deviceId; 091 092 /** 093 * Sub sys ID of the GPU, only available on Windows. 094 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 095 */ 096 public final Number subSysId; 097 098 /** 099 * Revision of the GPU, only available on Windows. 100 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 101 */ 102 public final Number revision; 103 104 /** String description of the GPU vendor, if the PCI ID is not available. */ 105 public final String vendorString; 106 107 /** String description of the GPU device, if the PCI ID is not available. */ 108 public final String deviceString; 109 110 /** String description of the GPU driver vendor. */ 111 public final String driverVendor; 112 113 /** String description of the GPU driver version. */ 114 public final String driverVersion; 115 116 /** Constructor. Please review this class' fields for documentation. */ 117 public GPUDevice( 118 ReadOnlyList<Boolean> isPresent, Number vendorId, Number deviceId, Number subSysId, 119 Number revision, String vendorString, String deviceString, String driverVendor, 120 String driverVersion 121 ) 122 { 123 super(singleton, Domains.SystemInfo, "GPUDevice", 8); 124 125 this.vendorId = vendorId; 126 this.deviceId = deviceId; 127 this.subSysId = subSysId; 128 this.revision = revision; 129 this.vendorString = vendorString; 130 this.deviceString = deviceString; 131 this.driverVendor = driverVendor; 132 this.driverVersion = driverVersion; 133 134 this.isPresent = (isPresent == null) 135 ? singleton.generateIsPresentList(this) 136 : THROWS.check(isPresent, 8, "SystemInfo.GPUDevice"); 137 } 138 139 /** Creates an instance of this class from a {@link JsonObject}.*/ 140 public static GPUDevice fromJSON(JsonObject jo) 141 { return singleton.fromJSON(jo); } 142 143 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 144 public static NestedDescriptor<GPUDevice> descriptor() 145 { return singleton.descriptor(); } 146 } 147 148 /** 149 * Provides information about the GPU(s) on the system. 150 * 151 * <EMBED CLASS=globalDefs DATA-DOMAIN=SystemInfo DATA-API=BrowserAPI> 152 */ 153 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 154 public static class GPUInfo 155 extends BaseType<GPUInfo> 156 implements java.io.Serializable 157 { 158 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 159 protected static final long serialVersionUID = 1; 160 161 private static final NestedHelper<SystemInfo.GPUInfo> singleton = 162 Torello.Browser.BrowserAPI.NestedHelpers.Types. 163 SystemInfo$$GPUInfo$$.singleton; 164 165 /** The graphics devices on the system. Element 0 is the primary GPU. */ 166 public final SystemInfo.GPUDevice[] devices; 167 168 /** 169 * An optional dictionary of additional GPU related attributes. 170 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 171 */ 172 public final JsonValue auxAttributes; 173 174 /** 175 * An optional dictionary of graphics features and their status. 176 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 177 */ 178 public final JsonValue featureStatus; 179 180 /** An optional array of GPU driver bug workarounds. */ 181 public final String[] driverBugWorkarounds; 182 183 /** Supported accelerated video decoding capabilities. */ 184 public final SystemInfo.VideoDecodeAcceleratorCapability[] videoDecoding; 185 186 /** Supported accelerated video encoding capabilities. */ 187 public final SystemInfo.VideoEncodeAcceleratorCapability[] videoEncoding; 188 189 /** Supported accelerated image decoding capabilities. */ 190 public final SystemInfo.ImageDecodeAcceleratorCapability[] imageDecoding; 191 192 /** Constructor. Please review this class' fields for documentation. */ 193 public GPUInfo( 194 ReadOnlyList<Boolean> isPresent, GPUDevice[] devices, JsonValue auxAttributes, 195 JsonValue featureStatus, String[] driverBugWorkarounds, 196 VideoDecodeAcceleratorCapability[] videoDecoding, 197 VideoEncodeAcceleratorCapability[] videoEncoding, 198 ImageDecodeAcceleratorCapability[] imageDecoding 199 ) 200 { 201 super(singleton, Domains.SystemInfo, "GPUInfo", 7); 202 203 this.devices = devices; 204 this.auxAttributes = auxAttributes; 205 this.featureStatus = featureStatus; 206 this.driverBugWorkarounds = driverBugWorkarounds; 207 this.videoDecoding = videoDecoding; 208 this.videoEncoding = videoEncoding; 209 this.imageDecoding = imageDecoding; 210 211 this.isPresent = (isPresent == null) 212 ? singleton.generateIsPresentList(this) 213 : THROWS.check(isPresent, 7, "SystemInfo.GPUInfo"); 214 } 215 216 /** Creates an instance of this class from a {@link JsonObject}.*/ 217 public static GPUInfo fromJSON(JsonObject jo) 218 { return singleton.fromJSON(jo); } 219 220 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 221 public static NestedDescriptor<GPUInfo> descriptor() 222 { return singleton.descriptor(); } 223 } 224 225 /** 226 * Describes a supported image decoding profile with its associated minimum and 227 * maximum resolutions and subsampling. 228 * 229 * <EMBED CLASS=globalDefs DATA-DOMAIN=SystemInfo DATA-API=BrowserAPI> 230 */ 231 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 232 public static class ImageDecodeAcceleratorCapability 233 extends BaseType<ImageDecodeAcceleratorCapability> 234 implements java.io.Serializable 235 { 236 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 237 protected static final long serialVersionUID = 1; 238 239 private static final NestedHelper<SystemInfo.ImageDecodeAcceleratorCapability> singleton = 240 Torello.Browser.BrowserAPI.NestedHelpers.Types. 241 SystemInfo$$ImageDecodeAcceleratorCapability$$.singleton; 242 243 /** 244 * Image coded, e.g. Jpeg. 245 * <EMBED CLASS='external-html' DATA-D=SystemInfo DATA-C=ImageType DATA-F=imageType DATA-FILE-ID=CDP.EL2> 246 * @see BaseType#enumStrList(String) 247 */ 248 public final String imageType; 249 250 /** Maximum supported dimensions of the image in pixels. */ 251 public final SystemInfo.Size maxDimensions; 252 253 /** Minimum supported dimensions of the image in pixels. */ 254 public final SystemInfo.Size minDimensions; 255 256 /** 257 * Optional array of supported subsampling formats, e.g. 4:2:0, if known. 258 * <EMBED CLASS='external-html' DATA-D=SystemInfo DATA-C=SubsamplingFormat DATA-F=subsamplings DATA-FILE-ID=CDP.EL2> 259 * @see BaseType#enumStrList(String) 260 */ 261 public final String[] subsamplings; 262 263 /** Constructor. Please review this class' fields for documentation. */ 264 public ImageDecodeAcceleratorCapability( 265 ReadOnlyList<Boolean> isPresent, String imageType, Size maxDimensions, 266 Size minDimensions, String[] subsamplings 267 ) 268 { 269 super(singleton, Domains.SystemInfo, "ImageDecodeAcceleratorCapability", 4); 270 271 this.imageType = imageType; 272 this.maxDimensions = maxDimensions; 273 this.minDimensions = minDimensions; 274 this.subsamplings = subsamplings; 275 276 this.isPresent = (isPresent == null) 277 ? singleton.generateIsPresentList(this) 278 : THROWS.check(isPresent, 4, "SystemInfo.ImageDecodeAcceleratorCapability"); 279 } 280 281 /** Creates an instance of this class from a {@link JsonObject}.*/ 282 public static ImageDecodeAcceleratorCapability fromJSON(JsonObject jo) 283 { return singleton.fromJSON(jo); } 284 285 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 286 public static NestedDescriptor<ImageDecodeAcceleratorCapability> descriptor() 287 { return singleton.descriptor(); } 288 } 289 290 /** 291 * Represents process info. 292 * 293 * <EMBED CLASS=globalDefs DATA-DOMAIN=SystemInfo DATA-API=BrowserAPI> 294 */ 295 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 296 public static class ProcessInfo 297 extends BaseType<ProcessInfo> 298 implements java.io.Serializable 299 { 300 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 301 protected static final long serialVersionUID = 1; 302 303 private static final NestedHelper<SystemInfo.ProcessInfo> singleton = 304 Torello.Browser.BrowserAPI.NestedHelpers.Types. 305 SystemInfo$$ProcessInfo$$.singleton; 306 307 /** Specifies process type. */ 308 public final String type; 309 310 /** Specifies process id. */ 311 public final int id; 312 313 /** 314 * Specifies cumulative CPU usage in seconds across all threads of the 315 * process since the process start. 316 */ 317 public final Number cpuTime; 318 319 /** Constructor. Please review this class' fields for documentation. */ 320 public ProcessInfo(ReadOnlyList<Boolean> isPresent, String type, int id, Number cpuTime) 321 { 322 super(singleton, Domains.SystemInfo, "ProcessInfo", 3); 323 324 this.type = type; 325 this.id = id; 326 this.cpuTime = cpuTime; 327 328 this.isPresent = (isPresent == null) 329 ? singleton.generateIsPresentList(this) 330 : THROWS.check(isPresent, 3, "SystemInfo.ProcessInfo"); 331 } 332 333 /** Creates an instance of this class from a {@link JsonObject}.*/ 334 public static ProcessInfo fromJSON(JsonObject jo) 335 { return singleton.fromJSON(jo); } 336 337 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 338 public static NestedDescriptor<ProcessInfo> descriptor() 339 { return singleton.descriptor(); } 340 } 341 342 /** 343 * Describes the width and height dimensions of an entity. 344 * 345 * <EMBED CLASS=globalDefs DATA-DOMAIN=SystemInfo DATA-API=BrowserAPI> 346 */ 347 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 348 public static class Size 349 extends BaseType<Size> 350 implements java.io.Serializable 351 { 352 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 353 protected static final long serialVersionUID = 1; 354 355 private static final NestedHelper<SystemInfo.Size> singleton = 356 Torello.Browser.BrowserAPI.NestedHelpers.Types. 357 SystemInfo$$Size$$.singleton; 358 359 /** Width in pixels. */ 360 public final int width; 361 362 /** Height in pixels. */ 363 public final int height; 364 365 /** Constructor. Please review this class' fields for documentation. */ 366 public Size(ReadOnlyList<Boolean> isPresent, int width, int height) 367 { 368 super(singleton, Domains.SystemInfo, "Size", 2); 369 370 this.width = width; 371 this.height = height; 372 373 this.isPresent = (isPresent == null) 374 ? singleton.generateIsPresentList(this) 375 : THROWS.check(isPresent, 2, "SystemInfo.Size"); 376 } 377 378 /** Creates an instance of this class from a {@link JsonObject}.*/ 379 public static Size fromJSON(JsonObject jo) 380 { return singleton.fromJSON(jo); } 381 382 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 383 public static NestedDescriptor<Size> descriptor() 384 { return singleton.descriptor(); } 385 } 386 387 /** 388 * Describes a supported video decoding profile with its associated minimum and 389 * maximum resolutions. 390 * 391 * <EMBED CLASS=globalDefs DATA-DOMAIN=SystemInfo DATA-API=BrowserAPI> 392 */ 393 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 394 public static class VideoDecodeAcceleratorCapability 395 extends BaseType<VideoDecodeAcceleratorCapability> 396 implements java.io.Serializable 397 { 398 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 399 protected static final long serialVersionUID = 1; 400 401 private static final NestedHelper<SystemInfo.VideoDecodeAcceleratorCapability> singleton = 402 Torello.Browser.BrowserAPI.NestedHelpers.Types. 403 SystemInfo$$VideoDecodeAcceleratorCapability$$.singleton; 404 405 /** Video codec profile that is supported, e.g. VP9 Profile 2. */ 406 public final String profile; 407 408 /** Maximum video dimensions in pixels supported for this |profile|. */ 409 public final SystemInfo.Size maxResolution; 410 411 /** Minimum video dimensions in pixels supported for this |profile|. */ 412 public final SystemInfo.Size minResolution; 413 414 /** Constructor. Please review this class' fields for documentation. */ 415 public VideoDecodeAcceleratorCapability( 416 ReadOnlyList<Boolean> isPresent, String profile, Size maxResolution, 417 Size minResolution 418 ) 419 { 420 super(singleton, Domains.SystemInfo, "VideoDecodeAcceleratorCapability", 3); 421 422 this.profile = profile; 423 this.maxResolution = maxResolution; 424 this.minResolution = minResolution; 425 426 this.isPresent = (isPresent == null) 427 ? singleton.generateIsPresentList(this) 428 : THROWS.check(isPresent, 3, "SystemInfo.VideoDecodeAcceleratorCapability"); 429 } 430 431 /** Creates an instance of this class from a {@link JsonObject}.*/ 432 public static VideoDecodeAcceleratorCapability fromJSON(JsonObject jo) 433 { return singleton.fromJSON(jo); } 434 435 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 436 public static NestedDescriptor<VideoDecodeAcceleratorCapability> descriptor() 437 { return singleton.descriptor(); } 438 } 439 440 /** 441 * Describes a supported video encoding profile with its associated maximum 442 * resolution and maximum framerate. 443 * 444 * <EMBED CLASS=globalDefs DATA-DOMAIN=SystemInfo DATA-API=BrowserAPI> 445 */ 446 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 447 public static class VideoEncodeAcceleratorCapability 448 extends BaseType<VideoEncodeAcceleratorCapability> 449 implements java.io.Serializable 450 { 451 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 452 protected static final long serialVersionUID = 1; 453 454 private static final NestedHelper<SystemInfo.VideoEncodeAcceleratorCapability> singleton = 455 Torello.Browser.BrowserAPI.NestedHelpers.Types. 456 SystemInfo$$VideoEncodeAcceleratorCapability$$.singleton; 457 458 /** Video codec profile that is supported, e.g H264 Main. */ 459 public final String profile; 460 461 /** Maximum video dimensions in pixels supported for this |profile|. */ 462 public final SystemInfo.Size maxResolution; 463 464 /** 465 * Maximum encoding framerate in frames per second supported for this 466 * |profile|, as fraction's numerator and denominator, e.g. 24/1 fps, 467 * 24000/1001 fps, etc. 468 */ 469 public final int maxFramerateNumerator; 470 471 /** <CODE>[No Description Provided by Google]</CODE> */ 472 public final int maxFramerateDenominator; 473 474 /** Constructor. Please review this class' fields for documentation. */ 475 public VideoEncodeAcceleratorCapability( 476 ReadOnlyList<Boolean> isPresent, String profile, Size maxResolution, 477 int maxFramerateNumerator, int maxFramerateDenominator 478 ) 479 { 480 super(singleton, Domains.SystemInfo, "VideoEncodeAcceleratorCapability", 4); 481 482 this.profile = profile; 483 this.maxResolution = maxResolution; 484 this.maxFramerateNumerator = maxFramerateNumerator; 485 this.maxFramerateDenominator = maxFramerateDenominator; 486 487 this.isPresent = (isPresent == null) 488 ? singleton.generateIsPresentList(this) 489 : THROWS.check(isPresent, 4, "SystemInfo.VideoEncodeAcceleratorCapability"); 490 } 491 492 /** Creates an instance of this class from a {@link JsonObject}.*/ 493 public static VideoEncodeAcceleratorCapability fromJSON(JsonObject jo) 494 { return singleton.fromJSON(jo); } 495 496 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 497 public static NestedDescriptor<VideoEncodeAcceleratorCapability> descriptor() 498 { return singleton.descriptor(); } 499 } 500 501 502 // ******************************************************************************************** 503 // ******************************************************************************************** 504 // Command-Return Types 505 // ******************************************************************************************** 506 // ******************************************************************************************** 507 508 509 /** 510 * Returns information about the system. 511 * 512 * <EMBED CLASS=globalDefs DATA-DOMAIN=SystemInfo DATA-API=BrowserAPI DATA-CMD=getInfo> 513 * @see SystemInfo#getInfo 514 */ 515 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_CMD_JDHBI") 516 public static class getInfo$$RET 517 extends BaseType<getInfo$$RET> 518 implements java.io.Serializable 519 { 520 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 521 protected static final long serialVersionUID = 1; 522 523 private static final NestedHelper<SystemInfo.getInfo$$RET> singleton = 524 Torello.Browser.BrowserAPI.NestedHelpers.CmdReturns. 525 SystemInfo$$getInfo$$RET.singleton; 526 527 /** Information about the GPUs on the system. */ 528 public final SystemInfo.GPUInfo gpu; 529 530 /** 531 * A platform-dependent description of the model of the machine. On Mac OS, this is, for 532 * example, 'MacBookPro'. Will be the empty string if not supported. 533 */ 534 public final String modelName; 535 536 /** 537 * A platform-dependent description of the version of the machine. On Mac OS, this is, for 538 * example, '10.1'. Will be the empty string if not supported. 539 */ 540 public final String modelVersion; 541 542 /** 543 * The command line string used to launch the browser. Will be the empty string if not 544 * supported. 545 */ 546 public final String commandLine; 547 548 /** Constructor. Please review this class' fields for documentation. */ 549 public getInfo$$RET( 550 ReadOnlyList<Boolean> isPresent, GPUInfo gpu, String modelName, 551 String modelVersion, String commandLine 552 ) 553 { 554 super(singleton, Domains.SystemInfo, "getInfo", 4); 555 556 this.gpu = gpu; 557 this.modelName = modelName; 558 this.modelVersion = modelVersion; 559 this.commandLine = commandLine; 560 561 this.isPresent = (isPresent == null) 562 ? singleton.generateIsPresentList(this) 563 : THROWS.check(isPresent, 4, "SystemInfo.getInfo$$RET"); 564 } 565 566 /** Creates an instance of this class from a {@link JsonObject}.*/ 567 public static getInfo$$RET fromJSON(JsonObject jo) 568 { return singleton.fromJSON(jo); } 569 570 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 571 public static NestedDescriptor<getInfo$$RET> descriptor() 572 { return singleton.descriptor(); } 573 } 574 575 576 577 578 // ******************************************************************************************** 579 // ******************************************************************************************** 580 // Commands 581 // ******************************************************************************************** 582 // ******************************************************************************************** 583 584 585 /** 586 * Returns information about the feature state. 587 * 588 * @param featureState - 589 * 590 * @return An instance of <CODE>{@link Script}<Boolean></CODE> 591 * 592 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 593 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 594 * <CODE><Boolean></CODE> will be returned 595 * 596 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 597 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 598 * be retrieved.</I> 599 * 600 * <BR /><BR /><DIV CLASS=JDHint> 601 * This Browser Function's {@code Promise} returns: 602 * <CODE>Boolean (<B>featureEnabled</B>)</CODE> 603 * </DIV> 604 */ 605 public static Script<Boolean> getFeatureState(String featureState) 606 { 607 // Build the JSON Request-Object (as a String); only 1 Parameter is passed 608 final String requestJSON = WriteJSON.get 609 (CDPTypes.STRING, "featureState", false, "SystemInfo.getFeatureState", featureState); 610 611 return new Script<>( 612 Domains.SystemInfo, "getFeatureState", requestJSON, 613 jo -> ReadBoxedJSON.getBoolean(jo, "featureEnabled", JFlag.RD_N | JFlag.RD_M, DV.NULL_BOOL), 614 Boolean.class 615 ); 616 } 617 618 /** 619 * Returns information about the system. 620 * 621 * @return An instance of <CODE>{@link Script}<{@link getInfo$$RET}></CODE> 622 * 623 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 624 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 625 * <CODE><{@link getInfo$$RET}></CODE> will be returned 626 * 627 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 628 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 629 * be retrieved.</I> 630 * 631 * <BR /><BR /><DIV CLASS=JDHint> 632 * This Browser Function's {@code Promise} returns:{@link getInfo$$RET} 633 * A dedicated return type implies that the browser may return more than 1 datum 634 * </DIV> 635 */ 636 public static Script<getInfo$$RET> getInfo() 637 { 638 // Ultra-Simple Request JSON - Because this method has no parameters 639 final String requestJSON = "{\"method\":\"SystemInfo.getInfo\"}"; 640 641 return new Script<>( 642 Domains.SystemInfo, "getInfo", requestJSON, 643 getInfo$$RET::fromJSON, 644 getInfo$$RET.class 645 ); 646 } 647 648 /** 649 * Returns information about all running processes. 650 * 651 * @return An instance of <CODE>{@link Script}<{@link SystemInfo.ProcessInfo}[]></CODE> 652 * 653 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 654 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 655 * <CODE><{@link SystemInfo.ProcessInfo}[]></CODE> will be returned 656 * 657 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 658 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 659 * be retrieved.</I> 660 * 661 * <BR /><BR /><DIV CLASS=JDHint> 662 * This Browser Function's {@code Promise} returns: 663 * <CODE>{@link SystemInfo.ProcessInfo}[] (<B>processInfo</B>)</CODE> 664 * <BR /> 665 * An array of process info blocks. 666 * </DIV> 667 */ 668 public static Script<SystemInfo.ProcessInfo[]> getProcessInfo() 669 { 670 // Ultra-Simple Request JSON - Because this method has no parameters 671 final String requestJSON = "{\"method\":\"SystemInfo.getProcessInfo\"}"; 672 673 return new Script<>( 674 Domains.SystemInfo, "getProcessInfo", requestJSON, 675 SystemInfo$$Commands::getProcessInfo, 676 SystemInfo.ProcessInfo[].class 677 ); 678 } 679 680 681}