VehicleZoneProperty

data class VehicleZoneProperty<A : VehicleArea, T : VehicleProperties.VehicleProperty<*>>(val zoneProperties: Map<VehicleZone<A>, T>) : Parcelable

A zone property is used for VehicleProperty instances which are bound to vehicle area zones. The zone property can be in one of 4 states:

  • Unsupported: the property is not supported by the vehicle platform.

  • Unsupported for specific vehicle area: the property is supported for a specific vehicle area, but unsupported for a different vehicle area.

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

  • Supported and available for a specific vehicle area: the property is available and has a valid value.

Usage:

val unsupported = property == null

val unsupportedForRow3Right =
property.zoneProperties[ThirdRowRightSeat()] == null

val supportedButUnavailableForRow3Right =
property.zoneProperties[ThirdRowRightSeat()].value == null

val supportedAndAvailableForRow3Right =
property.zoneProperties[ThirdRowRightSeat()].value != null

Parameters

A

The area type as provided by VehicleArea.

T

The type of the property's value.

zoneProperties

A map containing the properties per VehicleZone.

Constructors

Link copied to clipboard
fun <A : VehicleArea, T : VehicleProperties.VehicleProperty<*>> VehicleZoneProperty(zoneProperties: Map<VehicleZone<A>, T>)

Properties

Link copied to clipboard
val zoneProperties: Map<VehicleZone<A>, T>

Functions

Link copied to clipboard
fun getFirstZonesWithAnyArea(areas: Set<VehicleArea>): Set<VehicleZone<A>>?

Returns the Set of the first VehicleZones that contain any of the given areas.

Link copied to clipboard
fun getFirstZoneWithAreas(areas: Set<VehicleArea>): VehicleZone<A>?

Returns the first supported VehicleZone that contains the given set of VehicleAreas. It can contain other areas as well, but it must contain the areas from the given set.

Link copied to clipboard
fun getPropertyForArea(area: VehicleArea): T?

Returns VehicleProperty for a given VehicleArea if there is one.

Link copied to clipboard
fun getZone(area: VehicleArea): VehicleZone<A>?

Returns the first supported VehicleZone that contains the given VehicleArea.

Link copied to clipboard
fun getZonesWithOneArea(areas: Set<VehicleArea>): Set<VehicleZone<A>>?

Returns the Set of VehicleZones that contain exactly one of the given areas.

Link copied to clipboard
fun getZoneWithOnlyAreas(areas: Set<VehicleArea>): VehicleZone<A>?

Returns the supported VehicleZone that contains only the given set of VehicleAreas.

Link copied to clipboard
fun isAreaAvailable(area: A): Boolean

Checks whether this VehicleProperty is currently available for a given VehicleArea.

Link copied to clipboard
fun isAreaSupported(area: A): Boolean

Checks whether this VehicleProperty is supported by the vehicle for a given VehicleArea.

Inherited functions

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)