Skip to content

Commit

Permalink
Remove sealed classes
Browse files Browse the repository at this point in the history
  • Loading branch information
DzmitryFomchyn committed Sep 28, 2023
1 parent 4efd4f5 commit d3819b0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.mapbox.navigator.SensorType
* Data obtained from sensors
*/
@ExperimentalPreviewMapboxNavigationAPI
sealed class SensorData {
abstract class SensorData {

/**
* Weather condition obtained from sensors
Expand Down Expand Up @@ -49,7 +49,7 @@ sealed class SensorData {
/**
* Weather condition type.
*/
sealed class Condition {
abstract class Condition {

/**
* Rain weather condition
Expand Down Expand Up @@ -127,6 +127,7 @@ sealed class SensorData {
is Lane -> {
SensorType.LANE to toValue()
}
else -> error("Unsupported type: $javaClass")
}
return com.mapbox.navigator.SensorData(type, elapsedRealtimeNanos, value)
}
Expand All @@ -136,6 +137,7 @@ sealed class SensorData {
is Weather.Condition.Rain -> 0
is Weather.Condition.Snow -> 1
is Weather.Condition.Fog -> 2
else -> error("Unsupported weather condition type: $condition")
}
return Value.valueOf(order)
}
Expand Down

0 comments on commit d3819b0

Please sign in to comment.