VehicleProperties

A class holding a vehicle property.

A property can be in one of 3 states:

  • Unsupported: the property is not supported by the vehicle platform. In this case the property itself is set to null.

  • Supported but unavailable: the property is temporarily unavailable or has invalid value. Indicated by the value field of the property being set to null.

  • Available: the property is available and has a valid value.

Usage:

when {
property == null -> notSupported()
property.value == null -> supportedButNotAvailable()
else -> supportedAndAvailable()
}

Or when the supported state is not relevant:

when (property?.value) {
null -> notSupportedOrNotAvailable()
else -> supportedAndAvailable()
}

Constructors

Link copied to clipboard

Types

Link copied to clipboard

Property holding an optional Boolean value.

Link copied to clipboard

Property holding an optional List value.

Link copied to clipboard

Property holding an optional Number value.

Link copied to clipboard

Property holding an optional Comparable value (such as a number) constrained by the range.

Link copied to clipboard
data class RestrictedSetProperty<T : Parcelable>(val value: Set<T>?, val supportedCombinations: Set<Set<T>>) : VehicleProperties.VehicleProperty<Set<T>>

Property holding an optional Set value of which the combination is guaranteed to be one of the combinations as provided by supportedCombinations.

Link copied to clipboard

Property holding an optional Set value.

Link copied to clipboard

Property holding an optional value of type T.

Link copied to clipboard

Property holding an optional String value.

Link copied to clipboard

Property holding an optional VehicleArea value.

Link copied to clipboard
abstract class VehicleProperty<T>(val value: T?) : Parcelable

Class to be extended by all vehicle properties.