public class PowerSourceImpl extends AbstractOshiJsonObject implements PowerSource
| Constructor and Description |
|---|
PowerSourceImpl(PowerSource powerSource)
Creates a new platform-specific PowerSource object wrapping the provided
argument
|
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Name of the power source (e.g., InternalBattery-0)
|
double |
getRemainingCapacity()
Remaining capacity as a fraction of max capacity.
|
double |
getTimeRemaining()
Estimated time remaining on the power source, in seconds.
|
javax.json.JsonObject |
toJSON(Properties properties)
Returns this object as a
JsonObject. |
toCompactJSON, toCompactJSON, toJSON, toPrettyJSON, toPrettyJSON, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waittoCompactJSON, toCompactJSON, toJSON, toPrettyJSON, toPrettyJSONpublic PowerSourceImpl(PowerSource powerSource)
powerSource - a platform-specific PowerSource objectpublic String getName()
getName in interface PowerSourcepublic double getRemainingCapacity()
getRemainingCapacity in interface PowerSourcepublic double getTimeRemaining()
getTimeRemaining in interface PowerSourcepublic javax.json.JsonObject toJSON(Properties properties)
JsonObject. The provided
properties will be set on this object to configure the type of
information returned using this and future invocations of
OshiJsonObject.toJSON().toJSON in interface OshiJsonObjectproperties - Properties to configure returned resultsJsonObject for this class.Copyright © 2010–2017 oshi. All rights reserved.