Class Win32Battery

java.lang.Object
io.github.eggy03.ferrumx.windows.entity.peripheral.Win32Battery

@ShallowImmutable public class Win32Battery extends Object
Immutable representation of a battery device on a Windows system.

Fields correspond to properties retrieved from the Win32_Battery WMI class.

Usage example

// Build a new battery instance
Win32Battery battery = Win32Battery.builder()
    .deviceId("BAT0")
    .name("Primary Battery")
    .estimatedChargeRemaining(75)
    .build();

// Modify using toBuilder (copy-on-write)
Win32Battery updated = battery.toBuilder()
    .estimatedChargeRemaining(50)
    .build();
Since:
3.0.0
See Also:
  • Field Details

    • deviceId

      @SerializedName("DeviceID") @Nullable @Nullable String deviceId
      Identifier of the battery.
    • caption

      @SerializedName("Caption") @Nullable @Nullable String caption
      Short, one-line description of the battery object.
    • description

      @SerializedName("Description") @Nullable @Nullable String description
      Description of the battery.
    • name

      @SerializedName("Name") @Nullable @Nullable String name
      Label by which the battery is known.
    • status

      @SerializedName("Status") @Nullable @Nullable String status
      Current operational status of the battery device.

      Possible OPERATIONAL values:

      • "OK"
      • "Degraded"
      • "Pred Fail"

      Possible NON-OPERATIONAL values:

      • "Unknown"
      • "Error"
      • "Starting"
      • "Stopping"
      • "Service"

      Possible OTHER values:

      • "Stressed"
      • "NonRecover"
      • "No Contact"
      • "Lost Comm"
    • powerManagementCapabilities

      @SerializedName("PowerManagementCapabilities") @Nullable @Nullable List<Integer> powerManagementCapabilities
      Array of specific power-related capabilities supported by the battery.

      Possible values:

      • 0 - Unknown
      • 1 - Not Supported
      • 2 - Disabled
      • 3 - Enabled
      • 4 - Power Saving Modes Entered Automatically
      • 5 - Power State Settable
      • 6 - Power Cycling Supported
      • 7 - Timed Power On Supported
    • powerManagementSupported

      @SerializedName("PowerManagementSupported") @Nullable @Nullable Boolean powerManagementSupported
      Indicates whether the battery can be power-managed.
    • batteryStatus

      @SerializedName("BatteryStatus") @Nullable @Nullable Integer batteryStatus
      Status of the battery.

      Possible values:

      • 1 - Discharging
      • 2 - AC present, not charging
      • 3 - Fully Charged
      • 4 - Low
      • 5 - Critical
      • 6 - Charging
      • 7 - Charging and High
      • 8 - Charging and Low
      • 9 - Charging and Critical
      • 10 - Undefined
      • 11 - Partially Charged
    • chemistry

      @SerializedName("Chemistry") @Nullable @Nullable Integer chemistry
      Type of battery chemistry.

      Possible values:

      • 1 - Other
      • 2 - Unknown
      • 3 - Lead Acid
      • 4 - Nickel Cadmium
      • 5 - Nickel Metal Hydride
      • 6 - Lithium-ion
      • 7 - Zinc Air
      • 8 - Lithium Polymer
    • designCapacity

      @SerializedName("DesignCapacity") @Nullable @Nullable Integer designCapacity
      Design capacity of the battery in milliwatt-hours.
    • designVoltage

      @SerializedName("DesignVoltage") @Nullable @Nullable Integer designVoltage
      Design voltage of the battery in millivolts.
    • estimatedChargeRemaining

      @SerializedName("EstimatedChargeRemaining") @Nullable @Nullable Long estimatedChargeRemaining
      Estimated percentage of full charge remaining.
    • estimatedRunTime

      @SerializedName("EstimatedRunTime") @Nullable @Nullable Long estimatedRunTime
      Estimated remaining runtime of the battery in minutes.
  • Constructor Details

    • Win32Battery

      public Win32Battery()
  • Method Details

    • isPowerManagementSupported

      @Nullable public @Nullable Boolean isPowerManagementSupported()
    • toString

      @NotNull public @NotNull String toString()
      Retrieves the entity in a JSON pretty-print formatted string
      Overrides:
      toString in class Object
      Returns:
      the String value of the object in JSON pretty-print format