-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
116 additions
and
11 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
library/src/main/java/nl/endevelopment/r2randroid/r2rlib/enums/PlaceKind.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,51 @@ | ||
package nl.endevelopment.r2randroid.r2rlib.enums; | ||
|
||
/** | ||
* Created by jan on 29/08/2017. | ||
* <p> | ||
* unknown, continent, country, admin3, admin2, admin1, island, village, town, city, | ||
* capital, landmark, place, road, accomodation, station, airport, seaport, sea, lake and river | ||
*/ | ||
|
||
public enum PlaceKind { | ||
UNKNOWN("unknown"), | ||
CONTINENT("continent"), | ||
COUNTRY("country"), | ||
ADMIN3("admin3"), | ||
ADMIN2("admin2"), | ||
ADMIN1("admin1"), | ||
ISLAND("island"), | ||
VILLAGE("village"), | ||
TOWN("town"), | ||
CAPITAL("capital"), | ||
LANDMARK("landmark"), | ||
PLACE("place"), | ||
ROAD("road"), | ||
ACCOMODATION("accomodation"), | ||
STATION("station"), | ||
AIRPORT("airport"), | ||
SEAPORT("seaport"), | ||
SEA("sea"), | ||
LAKE("lake"), | ||
RIVER("river"); | ||
|
||
|
||
private String type; | ||
|
||
PlaceKind(String s) { | ||
type = s; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public static PlaceKind fromString(String text) { | ||
for (PlaceKind p : PlaceKind.values()) { | ||
if (p.getType().equalsIgnoreCase(text)) { | ||
return p; | ||
} | ||
} | ||
return UNKNOWN; | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
library/src/main/java/nl/endevelopment/r2randroid/r2rlib/enums/VehicleKind.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,48 @@ | ||
package nl.endevelopment.r2randroid.r2rlib.enums; | ||
|
||
/** | ||
* Created by jan on 29/08/2017. | ||
* <p> | ||
* unknown, plane, helicopter, car, bus, taxi, rideshare, shuttle, towncar, | ||
* train, tram, cablecar, subway, ferry, foot, animal, bicycle | ||
*/ | ||
|
||
public enum VehicleKind { | ||
UNKNOWN("unknown"), | ||
PLANE("plane"), | ||
HELICOPTER("helicopter"), | ||
CAR("car"), | ||
BUS("bus"), | ||
TAXI("taxi"), | ||
RIDESHARE("rideshare"), | ||
SHUTTLE("shuttle"), | ||
TOWNCAR("towncar"), | ||
TRAIN("train"), | ||
TRAM("tram"), | ||
CABLECAR("cablecar"), | ||
SUBWAY("subway"), | ||
FERRY("ferry"), | ||
FOOT("foot"), | ||
ANIMAL("animal"), | ||
BICYCLE("bicycle"); | ||
|
||
|
||
String type; | ||
|
||
VehicleKind(String s) { | ||
type = s; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public static VehicleKind fromString(String text) { | ||
for (VehicleKind vehicleKind : VehicleKind.values()) { | ||
if (vehicleKind.getType().equalsIgnoreCase(text)) { | ||
return vehicleKind; | ||
} | ||
} | ||
return UNKNOWN; | ||
} | ||
} |
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
11 changes: 1 addition & 10 deletions
11
library/src/main/java/nl/endevelopment/r2randroid/r2rlib/request/Rome2RioService.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 |
---|---|---|
@@ -1,25 +1,16 @@ | ||
package nl.endevelopment.r2randroid.r2rlib.request; | ||
|
||
import io.reactivex.Observable; | ||
import retrofit2.Call; | ||
import retrofit2.http.GET; | ||
import retrofit2.http.Path; | ||
import retrofit2.http.Url; | ||
|
||
/** | ||
* Created by jan on 14/07/16. | ||
* | ||
* <p> | ||
* http://<server>/api/1.4/json/Search?key=<key>&oName=Bern&dName=Zurich&noRideshare | ||
*/ | ||
|
||
public interface Rome2RioService { | ||
@GET("Search?oName={oName}&dName={dName}&oPos={oPosLat},{oPosLng}&dPost={dPosLat},{dPosLng}") | ||
Call<String> getSearchResponse( | ||
@Path("key") String key, | ||
@Path("oName") String oName, @Path("dName") String dName, | ||
@Path("oPosLat") double oPosLat, @Path("oPosLng") double oPosLng, | ||
@Path("dPosLat") double dPosLat, @Path("dPosLng") double dPosLng); | ||
|
||
@GET | ||
Observable<SearchResponse> getSearchResponseRx(@Url String url); | ||
} |