com.kuka.nav.battery
Class BatteryLevels

java.lang.Object
  extended by com.kuka.nav.battery.BatteryLevels

public class BatteryLevels
extends Object

Immutable class describing the different levels of the state of charge of the battery of a robot. The range from 0.0 to 1.0 is split into several levels with configurable thresholds separating them. Create new instances of this class using the builder pattern via newBuilder() and edit instances via toBuilder()


Nested Class Summary
 class BatteryLevels.BatteryLevel
          A single level of the battery state of charge.
static class BatteryLevels.BatteryLevelsBuilder
          Builder pattern for creating a valid BatteryLevels configuration.
 
Method Summary
 BatteryLevels.BatteryLevel getLevelFor(double stateOfCharge)
          Map from a state of charge value to the corresponding BatteryLevels.BatteryLevel configured.
 List<BatteryLevels.BatteryLevel> getLevels()
           
static BatteryLevels.BatteryLevelsBuilder newBuilder()
           
 BatteryLevels.BatteryLevelsBuilder toBuilder()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLevelFor

public BatteryLevels.BatteryLevel getLevelFor(double stateOfCharge)
Map from a state of charge value to the corresponding BatteryLevels.BatteryLevel configured. Values less than 0.0 and larger than 1.0 are mapped to the lowest and highest level, respectively.

Parameters:
stateOfCharge - state of charge value to map, 0.0 is the lowest value and 1.0 the highest
Returns:
the configured level representing the given state of charge value

getLevels

public List<BatteryLevels.BatteryLevel> getLevels()
Returns:
the full, unmodifiable sequence of configured state of charge levels, sorted from lowest to highest

newBuilder

public static BatteryLevels.BatteryLevelsBuilder newBuilder()
Returns:
a builder to construct a new BatteryLevels that can construct a new series of battery levels

toBuilder

public BatteryLevels.BatteryLevelsBuilder toBuilder()
Returns:
a builder that is initialized with a copy of this level configuration


Copyright © 2019. All rights reserved.