-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
group range and percent in fuel type
- Loading branch information
1 parent
4e591cb
commit 28944ba
Showing
13 changed files
with
114 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...tion/src/main/java/org/opentripplanner/service/vehiclerental/model/RentalVehicleFuel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.opentripplanner.service.vehiclerental.model; | ||
|
||
import javax.annotation.Nullable; | ||
import org.opentripplanner.transit.model.basic.Distance; | ||
|
||
/** | ||
* Contains information about the current battery or fuel status. | ||
* See the <a href="https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#vehicle_statusjson">GBFS | ||
* vehicle_status specification</a> for more details. | ||
*/ | ||
public class RentalVehicleFuel { | ||
|
||
/** | ||
* Current fuel percentage, expressed from 0 to 1. | ||
* <p> | ||
* May be {@code null}. | ||
*/ | ||
@Nullable | ||
public final Double percent; | ||
|
||
/** | ||
* Distance that the vehicle can travel with the current charge or fuel. | ||
* <p> | ||
* May be {@code null}. | ||
*/ | ||
@Nullable | ||
public final Distance range; | ||
|
||
public RentalVehicleFuel(@Nullable Double fuelPercent, @Nullable Distance range) { | ||
this.percent = fuelPercent; | ||
this.range = range; | ||
} | ||
|
||
@Nullable | ||
public Double getPercent() { | ||
return percent; | ||
} | ||
|
||
@Nullable | ||
public Integer getRange() { | ||
return this.range != null ? this.range.toMeters() : null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,9 @@ | |
networkId | ||
url | ||
} | ||
currentFuelPercent | ||
currentRangeMeters | ||
fuel { | ||
percent | ||
range | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters