VehicleProperties

class 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
fun VehicleProperties()

Types

Link copied to clipboard
data class BooleanProperty(val value: Boolean?) : VehicleProperties.VehicleProperty<Boolean>

Property holding an optional Boolean value.

Link copied to clipboard
data class ListProperty<T : Parcelable>(val value: List<T>?) : VehicleProperties.VehicleProperty<List<T>>

Property holding an optional List value.

Link copied to clipboard
data class NumberProperty<T : Number>(val value: T?) : VehicleProperties.VehicleProperty<T>

Property holding an optional Number value.

Link copied to clipboard
class RangedProperty<T : Comparable<T>> : VehicleProperties.VehicleProperty<T>

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
data class SetProperty<T : Parcelable>(val value: Set<T>?) : VehicleProperties.VehicleProperty<Set<T>>

Property holding an optional Set value.

Link copied to clipboard
class SingleProperty<T> : VehicleProperties.VehicleProperty<T>

Property holding an optional value of type T.

Link copied to clipboard
data class StringProperty(val value: String?) : VehicleProperties.VehicleProperty<String>

Property holding an optional String value.

Link copied to clipboard
data class VehicleAreaProperty<T : VehicleArea>(val value: T?) : VehicleProperties.VehicleProperty<T>

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.