Class WindowsPrinter

java.lang.Object
oshi.hardware.common.AbstractPrinter
oshi.hardware.common.platform.windows.WindowsPrinter
All Implemented Interfaces:
Printer

@Immutable public abstract class WindowsPrinter extends AbstractPrinter
Common Windows printer logic shared between JNA and FFM implementations.
  • Constructor Details

    • WindowsPrinter

      protected WindowsPrinter(String name, String driverName, String description, Printer.PrinterStatus status, String statusReason, boolean isDefault, boolean isLocal, String portName)
      Constructor.
      Parameters:
      name - the name
      driverName - the driverName
      description - the description
      status - the status
      statusReason - the statusReason
      isDefault - the isDefault
      isLocal - the isLocal
      portName - the portName
  • Method Details

    • parseStatus

      protected static Printer.PrinterStatus parseStatus(int statusCode, int errorState)
      Parses Win32_Printer PrinterStatus and DetectedErrorState codes.
      Parameters:
      statusCode - The PrinterStatus code from WMI.
      errorState - The DetectedErrorState code from WMI.
      Returns:
      The corresponding PrinterStatus enum value.
    • parseErrorState

      protected static String parseErrorState(int errorState)
      Converts a DetectedErrorState code to a human-readable string.
      Parameters:
      errorState - The DetectedErrorState code from WMI.
      Returns:
      A string describing the error state.