Class AbstractUsbDevice

java.lang.Object
oshi.hardware.common.AbstractUsbDevice
All Implemented Interfaces:
Comparable<UsbDevice>, UsbDevice
Direct Known Subclasses:
AixUsbDevice, FreeBsdUsbDevice, LinuxUsbDevice, MacUsbDevice, OpenBsdUsbDevice, SolarisUsbDevice, WindowsUsbDevice

@Immutable public abstract class AbstractUsbDevice extends Object implements UsbDevice
A USB device
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Description copied from interface: UsbDevice
      Name of the USB device
      Specified by:
      getName in interface UsbDevice
      Returns:
      The device name
    • getVendor

      public String getVendor()
      Description copied from interface: UsbDevice
      Vendor that manufactured the USB device
      Specified by:
      getVendor in interface UsbDevice
      Returns:
      The vendor name
    • getVendorId

      public String getVendorId()
      Description copied from interface: UsbDevice
      ID of the vendor that manufactured the USB device
      Specified by:
      getVendorId in interface UsbDevice
      Returns:
      The vendor ID, a 4-digit hex string
    • getProductId

      public String getProductId()
      Description copied from interface: UsbDevice
      Product ID of the USB device
      Specified by:
      getProductId in interface UsbDevice
      Returns:
      The product ID, a 4-digit hex string
    • getSerialNumber

      public String getSerialNumber()
      Description copied from interface: UsbDevice
      Serial number of the USB device
      Specified by:
      getSerialNumber in interface UsbDevice
      Returns:
      The serial number, if known
    • getUniqueDeviceId

      public String getUniqueDeviceId()
      Description copied from interface: UsbDevice
      A Unique Device ID of the USB device, such as the PnPDeviceID (Windows), Device Node Path (Linux), Registry Entry ID (macOS), or Device Node number (Unix)
      Specified by:
      getUniqueDeviceId in interface UsbDevice
      Returns:
      The Unique Device ID
    • getConnectedDevices

      public List<UsbDevice> getConnectedDevices()
      Description copied from interface: UsbDevice
      Other devices connected to this hub
      Specified by:
      getConnectedDevices in interface UsbDevice
      Returns:
      An UnmodifiableList of other devices connected to this hub, if any, or an empty list if none
    • compareTo

      public int compareTo(UsbDevice usb)
      Specified by:
      compareTo in interface Comparable<UsbDevice>
    • toString

      public String toString()
      Overrides:
      toString in class Object