createCoercedRangedProperty

fun <T : Parcelable, Comparable<T>> createCoercedRangedProperty(    range: ClosedRange<T>,     value: T?,     propertyIdentifier: String): VehicleProperties.RangedProperty<T>

Creates an instance of VehicleProperties.RangedProperty by coercing Parcelable into a given range.

If value exceeds maximum range, value is set to ClosedRange.endInclusive. If value is less than minimum range, value is set to ClosedRange.start.

Return

Instance of VehicleProperties.RangedProperty.

Parameters

T

The type of the value.

range

Range used when creating the VehicleProperties.RangedProperty instance.

value

Value used when creating the instance; the value will be coerced by using the provided range.

propertyIdentifier

Property ID or name, only used for logging purposes.


fun <T : Serializable, Comparable<T>> createCoercedRangedProperty(    range: ClosedRange<T>,     value: T?,     propertyIdentifier: String): VehicleProperties.RangedProperty<T>

Creates an instance of VehicleProperties.RangedProperty by coercing Serializable into a given range.

If value exceeds maximum range, value is set to ClosedRange.endInclusive. If value is less than minimum range, value is set to ClosedRange.start.

Return

Instance of VehicleProperties.RangedProperty.

Parameters

T

The type of the value.

range

Range used when creating the VehicleProperties.RangedProperty instance.

value

Value used when creating the instance, the value will be coerced by using the provided range.

propertyIdentifier

Property ID or name, only used for logging purposes.