Class Win32Battery
java.lang.Object
io.github.eggy03.ferrumx.windows.entity.peripheral.Win32Battery
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 Summary
FieldsModifier and TypeFieldDescription(package private) @Nullable IntegerStatus of the battery.(package private) @Nullable StringShort, one-line description of the battery object.(package private) @Nullable IntegerType of battery chemistry.(package private) @Nullable StringDescription of the battery.(package private) @Nullable IntegerDesign capacity of the battery in milliwatt-hours.(package private) @Nullable IntegerDesign voltage of the battery in millivolts.(package private) @Nullable StringIdentifier of the battery.(package private) @Nullable LongEstimated percentage of full charge remaining.(package private) @Nullable LongEstimated remaining runtime of the battery in minutes.(package private) @Nullable StringLabel by which the battery is known.Array of specific power-related capabilities supported by the battery.(package private) @Nullable BooleanIndicates whether the battery can be power-managed.(package private) @Nullable StringCurrent operational status of the battery device. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
deviceId
Identifier of the battery. -
caption
Short, one-line description of the battery object. -
description
Description of the battery. -
name
Label by which the battery is known. -
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> powerManagementCapabilitiesArray 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
Indicates whether the battery can be power-managed. -
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
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
Design capacity of the battery in milliwatt-hours. -
designVoltage
Design voltage of the battery in millivolts. -
estimatedChargeRemaining
Estimated percentage of full charge remaining. -
estimatedRunTime
Estimated remaining runtime of the battery in minutes.
-
-
Constructor Details
-
Win32Battery
public Win32Battery()
-
-
Method Details
-
isPowerManagementSupported
-
toString
-