Class AbstractUsbDevice

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

@Immutable
public abstract class AbstractUsbDevice
extends java.lang.Object
implements UsbDevice
A USB device
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractUsbDevice​(java.lang.String name, java.lang.String vendor, java.lang.String vendorId, java.lang.String productId, java.lang.String serialNumber, java.lang.String uniqueDeviceId, java.util.List<UsbDevice> connectedDevices)  
  • Method Summary

    Modifier and Type Method Description
    int compareTo​(UsbDevice usb)  
    java.util.List<UsbDevice> getConnectedDevices()
    Other devices connected to this hub
    java.lang.String getName()
    Name of the USB device
    java.lang.String getProductId()
    Product ID of the USB device
    java.lang.String getSerialNumber()
    Serial number of the USB device
    java.lang.String getUniqueDeviceId()
    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)
    java.lang.String getVendor()
    Vendor that manufactured the USB device
    java.lang.String getVendorId()
    ID of the vendor that manufactured the USB device
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

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

    • AbstractUsbDevice

      public AbstractUsbDevice​(java.lang.String name, java.lang.String vendor, java.lang.String vendorId, java.lang.String productId, java.lang.String serialNumber, java.lang.String uniqueDeviceId, java.util.List<UsbDevice> connectedDevices)
  • Method Details

    • getName

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

      public java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.util.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 java.lang.Comparable<UsbDevice>
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object