EnergyLevel.Builder


public final class EnergyLevel.Builder


A builder of EnergyLevel.

Summary

Public constructors

Public methods

@NonNull EnergyLevel

Constructs the EnergyLevel defined by this builder.

@NonNull EnergyLevel.Builder

Sets the remaining batter percentage.

@NonNull EnergyLevel.Builder

Sets the distance display unit.

@NonNull EnergyLevel.Builder

Sets if the remaining energy is low.

@NonNull EnergyLevel.Builder

Sets the remaining fuel percentage.

@NonNull EnergyLevel.Builder

Sets the fuel volume display unit.

@NonNull EnergyLevel.Builder

Sets the range of the remaining fuel in meters.

Public constructors

Builder

Added in 1.1.0
public Builder()

Public methods

build

Added in 1.1.0
public @NonNull EnergyLevel build()

Constructs the EnergyLevel defined by this builder.

setBatteryPercent

Added in 1.1.0
public @NonNull EnergyLevel.Builder setBatteryPercent(@NonNull CarValue<Float> batteryPercent)

Sets the remaining batter percentage.

setDistanceDisplayUnit

Added in 1.1.0
public @NonNull EnergyLevel.Builder setDistanceDisplayUnit(@NonNull CarValue<Integer> distanceDisplayUnit)

Sets the distance display unit.

Valid values are in CarUnit.

Throws
java.lang.NullPointerException

if distanceDisplayUnit is null

setEnergyIsLow

Added in 1.1.0
public @NonNull EnergyLevel.Builder setEnergyIsLow(@NonNull CarValue<Boolean> energyIsLow)

Sets if the remaining energy is low.

Throws
java.lang.NullPointerException

if energyIsLow is null

setFuelPercent

Added in 1.1.0
public @NonNull EnergyLevel.Builder setFuelPercent(@NonNull CarValue<Float> fuelPercent)

Sets the remaining fuel percentage.

Throws
java.lang.NullPointerException

if fuelPercent is null

setFuelVolumeDisplayUnit

Added in 1.1.0
@ExperimentalCarApi
public @NonNull EnergyLevel.Builder setFuelVolumeDisplayUnit(
    @NonNull CarValue<Integer> fuelVolumeDisplayUnit
)

Sets the fuel volume display unit.

Throws
java.lang.NullPointerException

if fuelVolumeDisplayUnit is null

setRangeRemainingMeters

Added in 1.1.0
public @NonNull EnergyLevel.Builder setRangeRemainingMeters(@NonNull CarValue<Float> rangeRemainingMeters)

Sets the range of the remaining fuel in meters.

Throws
java.lang.NullPointerException

if rangeRemaining is null