Package oshi.hardware.common
Class AbstractUsbDevice
java.lang.Object
oshi.hardware.common.AbstractUsbDevice
- Direct Known Subclasses:
FreeBsdUsbDevice
,LinuxUsbDevice
,MacUsbDevice
,SolarisUsbDevice
,WindowsUsbDevice
@Immutable public abstract class AbstractUsbDevice extends java.lang.Object implements UsbDevice
A USB device
-
Field Summary
Fields Modifier and Type Field Description protected UsbDevice[]
connectedDevices
protected java.lang.String
name
protected java.lang.String
productId
protected java.lang.String
serialNumber
protected java.lang.String
uniqueDeviceId
protected java.lang.String
vendor
protected java.lang.String
vendorId
-
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, UsbDevice[] connectedDevices)
Constructor for AbstractUsbDevice. -
Method Summary
Modifier and Type Method Description int
compareTo(UsbDevice usb)
UsbDevice[]
getConnectedDevices()
Other devices connected to this hubjava.lang.String
getName()
Name of the USB devicejava.lang.String
getProductId()
Product ID of the USB devicejava.lang.String
getSerialNumber()
Serial number of the USB devicejava.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 devicejava.lang.String
getVendorId()
ID of the vendor that manufactured the USB devicejava.lang.String
toString()
-
Field Details
-
name
protected java.lang.String name -
vendor
protected java.lang.String vendor -
vendorId
protected java.lang.String vendorId -
productId
protected java.lang.String productId -
serialNumber
protected java.lang.String serialNumber -
uniqueDeviceId
protected java.lang.String uniqueDeviceId -
connectedDevices
-
-
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, UsbDevice[] connectedDevices)Constructor for AbstractUsbDevice.
- Parameters:
name
- aString
object.vendor
- aString
object.vendorId
- aString
object.productId
- aString
object.serialNumber
- aString
object.uniqueDeviceId
- aString
object.connectedDevices
- an array ofUsbDevice
objects.
-
-
Method Details
-
getName
public java.lang.String getName()Description copied from interface:UsbDevice
Name of the USB device -
getVendor
public java.lang.String getVendor()Description copied from interface:UsbDevice
Vendor that manufactured the USB device -
getVendorId
public java.lang.String getVendorId()Description copied from interface:UsbDevice
ID of the vendor that manufactured the USB device- Specified by:
getVendorId
in interfaceUsbDevice
- 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 interfaceUsbDevice
- 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 interfaceUsbDevice
- 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 interfaceUsbDevice
- Returns:
- The Unique Device ID
-
getConnectedDevices
Description copied from interface:UsbDevice
Other devices connected to this hub- Specified by:
getConnectedDevices
in interfaceUsbDevice
- Returns:
- An array of other devices connected to this hub, if any, or an empty array if none
-
compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<UsbDevice>
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-