Class BsdPowerSource

java.lang.Object
oshi.hardware.common.AbstractPowerSource
oshi.hardware.common.platform.unix.BsdPowerSource
All Implemented Interfaces:
PowerSource

@ThreadSafe public final class BsdPowerSource extends AbstractPowerSource
Shared power-source implementation for BSDs that use apm and systat -ab sensors for battery state (NetBSD, OpenBSD).
  • Method Details

    • queryPowerSources

      protected List<PowerSource> queryPowerSources()
      Description copied from class: AbstractPowerSource
      Returns a fresh list of power sources for this platform, used by AbstractPowerSource.updateAttributes(). Each concrete subclass implements this by delegating to its own static getPowerSources() factory method.
      Specified by:
      queryPowerSources in class AbstractPowerSource
      Returns:
      A list of PowerSource objects representing batteries, etc.
    • getPowerSources

      public static List<PowerSource> getPowerSources()
      Gets Battery Information.
      Returns:
      A list of PowerSource objects representing batteries, etc.