Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

feat: Add new OTP2 pojos #34

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
115 changes: 101 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<name>opentripplanner-pojos</name>
<description>Plain Old Java Objects (POJOs) used for deserializing OpenTripPlanner server responses on Android devices.</description>

<issueManagement>
<system>GitHub</system>
<url>https://github.com/CUTR-at-USF/opentripplanner-pojos/issues</url>
Expand Down Expand Up @@ -34,21 +34,102 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.1.0</version>
</dependency>
</dependency>
<dependency>
<groupId>javax</groupId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can get rid of this javaee-api dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the pojos in the older code was using this dependency and it was throwing a compile error on the CI earlier.

<artifactId>javaee-api</artifactId>
<version>6.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>

<repositories>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get rid of these two EAP repositories? Typically releases should be on Maven Central and we should be able to pull from there.

<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray.kotlin.eap</id>
<name>Bintray Kotlin EAP Repository</name>
<url>https://dl.bintray.com/kotlin/kotlin-eap</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray.kotlin.eap</id>
<name>Bintray Kotlin EAP Repository</name>
<url>https://dl.bintray.com/kotlin/kotlin-eap</url>
</pluginRepository>
</pluginRepositories>

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source/>
<target/>
</configuration>
</plugin>
<!-- Run Ant tasks - commentOutXmlAnnotations -->
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmTarget>1.8</jvmTarget>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Run Ant tasks - commentOutXmlAnnotations -->
<!-- Uncomment this block to run commenOutXmlAnnotations on each "mvn clean" of project

<plugin>
Expand Down Expand Up @@ -98,5 +179,11 @@
<url>https://github.com/CUTR-at-USF/cutr-mvn-repo/raw/master/snapshots</url>
</snapshotRepository>
</distributionManagement>


<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<kotlin.version>1.4.10</kotlin.version>
</properties>

</project>
16 changes: 16 additions & 0 deletions src/edu/usf/cutr/otp/model/DebugOutput.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package edu.usf.cutr.otp.model
barbeau marked this conversation as resolved.
Show resolved Hide resolved

import java.util.HashMap


data class DebugOutput
(
val precalculationTime: Int? = null,
val directStreetRouterTime: Int? = null,
val transitRouterTime: Int? = null,
val filteringTime: Int? = null,
val renderingTime: Int? = null,
val totalTime: Int? = null,
val transitRouterTimes: TransitRouterTimes? = null,
val additionalProperties: MutableMap<String, Any> = HashMap()
)
8 changes: 8 additions & 0 deletions src/edu/usf/cutr/otp/model/Details.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package edu.usf.cutr.otp.model

import java.util.HashMap

data class Details
(
val additionalProperties: MutableMap<String, Any> = HashMap()
)
9 changes: 9 additions & 0 deletions src/edu/usf/cutr/otp/model/ElevationMetadata.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package edu.usf.cutr.otp.model


class ElevationMetadata
(
val ellipsoidToGeoidDifference: Double? = null,
val geoidElevation: Boolean? = null,
val additionalProperties: MutableMap<String, Any> = HashMap()
)
10 changes: 10 additions & 0 deletions src/edu/usf/cutr/otp/model/Fare.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package edu.usf.cutr.otp.model

import java.util.HashMap


class Fare {
val fare: Fare_? = null
val details: Details? = null
val additionalProperties: MutableMap<String, Any> = HashMap()
}
8 changes: 8 additions & 0 deletions src/edu/usf/cutr/otp/model/Fare_.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package edu.usf.cutr.otp.model

import java.util.HashMap


data class Fare_ (
val additionalProperties: MutableMap<String, Any> = HashMap()
)
11 changes: 11 additions & 0 deletions src/edu/usf/cutr/otp/model/From.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package edu.usf.cutr.otp.model


data class From
(
val name: String? = null,
val lon: Double? = null,
val lat: Double? = null,
val vertexType: String? = null,
val additionalProperties: MutableMap<String, Any> = HashMap()
)
12 changes: 12 additions & 0 deletions src/edu/usf/cutr/otp/model/From_.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package edu.usf.cutr.otp.model


data class From_
(
val name: String? = null,
val lon: Double? = null,
val lat: Double? = null,
val departure: Int? = null,
val vertexType: String? = null,
val additionalProperties: MutableMap<String, Any> = HashMap()
)
22 changes: 22 additions & 0 deletions src/edu/usf/cutr/otp/model/Itinerary.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package edu.usf.cutr.otp.model

import org.opentripplanner.routing.core.Fare


data class Itinerary (
val duration: Int? = null,
val startTime: Int? = null,
val endTime: Int? = null,
val walkTime: Int? = null,
val transitTime: Int? = null,
val waitingTime: Int? = null,
val walkDistance: Double? = null,
val walkLimitExceeded: Boolean? = null,
val elevationLost: Double? = null,
val elevationGained: Double? = null,
val transfers: Int? = null,
val fare: Fare? = null,
val legs: List<Leg>? = null,
val tooSloped: Boolean? = null,
val additionalProperties: MutableMap<String, Any> = HashMap()
)
24 changes: 24 additions & 0 deletions src/edu/usf/cutr/otp/model/Leg.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package edu.usf.cutr.otp.model


data class Leg (
val startTime: Int? = null,
val endTime: Int? = null,
val departureDelay: Int? = null,
val arrivalDelay: Int? = null,
val realTime: Boolean? = null,
val distance: Double? = null,
val pathway: Boolean? = null,
val mode: String? = null,
val transitLeg: Boolean? = null,
val route: String? = null,
val agencyTimeZoneOffset: Int? = null,
val interlineWithPreviousLeg: Boolean? = null,
val from: From_? = null,
val to: To_? = null,
val legGeometry: LegGeometry? = null,
val steps: List<Step>? = null,
val rentedBike: Boolean? = null,
val duration: Double? = null,
val additionalProperties: MutableMap<String, Any> = HashMap()
)
11 changes: 11 additions & 0 deletions src/edu/usf/cutr/otp/model/LegGeometry.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package edu.usf.cutr.otp.model

import java.util.HashMap


data class LegGeometry
(
val points: String? = null,
val length: Int? = null,
val additionalProperties: MutableMap<String, Any> = HashMap()
)
12 changes: 12 additions & 0 deletions src/edu/usf/cutr/otp/model/Metadata.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package edu.usf.cutr.otp.model

import java.util.HashMap


data class Metadata
(
val searchWindowUsed: Int? = null,
val nextDateTime: Int? = null,
val prevDateTime: Int? = null,
val additionalProperties: MutableMap<String, Any> = HashMap()
)
13 changes: 13 additions & 0 deletions src/edu/usf/cutr/otp/model/Plan.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package edu.usf.cutr.otp.model

import java.util.HashMap


data class Plan
(
val date: Int? = null,
val from: From? = null,
val to: To? = null,
val itineraries: List<Itinerary>? = null,
val additionalProperties: MutableMap<String, Any> = HashMap()
)
14 changes: 14 additions & 0 deletions src/edu/usf/cutr/otp/model/Planner.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package edu.usf.cutr.otp.model

import java.util.HashMap


data class Planner
(
val requestParameters: RequestParameters? = null,
val plan: Plan? = null,
val metadata: Metadata? = null,
val debugOutput: DebugOutput? = null,
val elevationMetadata: ElevationMetadata? = null,
val additionalProperties: MutableMap<String, Any> = HashMap()
)
11 changes: 11 additions & 0 deletions src/edu/usf/cutr/otp/model/RequestParameters.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package edu.usf.cutr.otp.model

import java.util.HashMap


data class RequestParameters
(
val fromPlace: String? = null,
val toPlace: String? = null,
val additionalProperties: MutableMap<String, Any> = HashMap()
)
16 changes: 16 additions & 0 deletions src/edu/usf/cutr/otp/model/Step.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package edu.usf.cutr.otp.model

data class Step
(
val distance: Double? = null,
val relativeDirection: String? = null,
val streetName: String? = null,
val absoluteDirection: String? = null,
val stayOn: Boolean? = null,
val area: Boolean? = null,
val bogusName: Boolean? = null,
val lon: Double? = null,
val lat: Double? = null,
val elevation: String? = null,
val additionalProperties: Map<String, Any> = HashMap(),
)
10 changes: 10 additions & 0 deletions src/edu/usf/cutr/otp/model/To.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package edu.usf.cutr.otp.model

data class To
(
val name: String? = null,
val lon: Double? = null,
val lat: Double? = null,
val vertexType: String? = null,
val additionalProperties: Map<String, Any> = HashMap()
)
11 changes: 11 additions & 0 deletions src/edu/usf/cutr/otp/model/To_.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package edu.usf.cutr.otp.model


data class To_(
val name: String? = null,
val lon: Double? = null,
val lat: Double? = null,
val arrival: Int? = null,
val vertexType: String? = null,
val additionalProperties: MutableMap<String, Any> = HashMap()
)
Loading