java.lang.Object
io.github.eggy03.ferrumx.windows.service.mainboard.BiosService
All Implemented Interfaces:
CommonServiceInterface<Bios>

public class BiosService extends Object implements CommonServiceInterface<Bios>
Service class for fetching BIOS information from the system.

This class executes the CimQuery.BIOS_QUERY PowerShell command and maps the resulting JSON into a list of Bios objects.

Thread safety

Methods of class are not thread safe.

Usage examples


 // Convenience API (creates its own short-lived session)
 BiosService biosService = new BiosService();
 List<Bios> biosList = biosService.get();

 // API with re-usable session (caller manages session lifecycle)
 try (PowerShell session = PowerShell.openSession()) {
     BiosService biosService = new BiosService();
     List<Bios> biosList = biosService.get(session);
 }
 
Since:
2.0.0
Author:
Egg-03
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull List<Bios>
    get()
    Retrieves a list of BIOS entries present in the system.
    @NotNull List<Bios>
    get(com.profesorfalken.jpowershell.PowerShell powerShell)
    Retrieves a list of BIOS entries present in the system using the caller's PowerShell session.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BiosService

      public BiosService()
  • Method Details

    • get

      @NotNull public @NotNull List<Bios> get()
      Retrieves a list of BIOS entries present in the system.

      Each invocation creates and uses a short-lived PowerShell session internally.

      Specified by:
      get in interface CommonServiceInterface<Bios>
      Returns:
      a list of Bios objects representing the system BIOS. Returns an empty list if no BIOS entries are detected.
      Throws:
      com.google.gson.JsonSyntaxException - if there is an error executing the PowerShell command or parsing the output.
    • get

      @NotNull public @NotNull List<Bios> get(com.profesorfalken.jpowershell.PowerShell powerShell)
      Retrieves a list of BIOS entries present in the system using the caller's PowerShell session.
      Specified by:
      get in interface CommonServiceInterface<Bios>
      Parameters:
      powerShell - an existing PowerShell session managed by the caller
      Returns:
      a list of Bios objects representing the system BIOS. Returns an empty list if no BIOS entries are detected.
      Throws:
      com.google.gson.JsonSyntaxException - if there is an error executing the PowerShell command or parsing the output.