diff --git a/src/main/java/de/stklcode/pubtrans/ura/UraClient.java b/src/main/java/de/stklcode/pubtrans/ura/UraClient.java index e8ae35b..bd4a592 100644 --- a/src/main/java/de/stklcode/pubtrans/ura/UraClient.java +++ b/src/main/java/de/stklcode/pubtrans/ura/UraClient.java @@ -256,6 +256,8 @@ public class UraClient implements Serializable { * * @param query The query. * @param consumer Consumer(s) for single trips. + * @return Trip reader. + * @throws IOException Error reading response. * @see #getTripsStream(Query, List) * @since 1.2.0 */ @@ -268,6 +270,8 @@ public class UraClient implements Serializable { * * @param query The query. * @param consumers Consumer(s) for single trips. + * @return Trip reader. + * @throws IOException Error retrieving stream response. * @since 1.2.0 */ public AsyncUraTripReader getTripsStream(final Query query, final List> consumers) throws IOException { @@ -286,7 +290,7 @@ public class UraClient implements Serializable { /** * Get list of stops without filters. * - * @return Lhe list. + * @return The list of stops. */ public List getStops() { return getStops(new Query()); @@ -564,6 +568,8 @@ public class UraClient implements Serializable { * Get trips for set filters. * * @param consumer Consumer for single trips. + * @return Trip reader. + * @throws IOException Errors retrieving stream response. * @see #getTripsStream(List) * @since 1.2.0 */ @@ -575,6 +581,8 @@ public class UraClient implements Serializable { * Get trips for set filters. * * @param consumers Consumers for single trips. + * @return Trip reader. + * @throws IOException Errors retrieving stream response. * @since 1.2.0 */ public AsyncUraTripReader getTripsStream(List> consumers) throws IOException { diff --git a/src/main/java/de/stklcode/pubtrans/ura/reader/AsyncUraTripReader.java b/src/main/java/de/stklcode/pubtrans/ura/reader/AsyncUraTripReader.java index 646a4d2..aee0317 100644 --- a/src/main/java/de/stklcode/pubtrans/ura/reader/AsyncUraTripReader.java +++ b/src/main/java/de/stklcode/pubtrans/ura/reader/AsyncUraTripReader.java @@ -30,7 +30,7 @@ import java.util.concurrent.*; import java.util.function.Consumer; /** - * Asynchronous stream reader foR URA stream API. + * Asynchronous stream reader for URA stream API. *

* This reader provides a handler for asynchronous stream events. * @@ -44,7 +44,7 @@ public class AsyncUraTripReader implements AutoCloseable { private final List> consumers; private final URL url; private CompletableFuture future; - private boolean cancelled; + private boolean canceled; /** * Initialize trip reader. @@ -82,7 +82,7 @@ public class AsyncUraTripReader implements AutoCloseable { BufferedReader br = new BufferedReader(new InputStreamReader(is))) { String version = null; String line = br.readLine(); - while (line != null && !this.cancelled) { + while (line != null && !this.canceled) { List l = mapper.readValue(line, List.class); // Check if result exists and has correct response type. if (l != null && !l.isEmpty()) { @@ -114,7 +114,7 @@ public class AsyncUraTripReader implements AutoCloseable { /** * Close the reader. * This is done by signaling cancel to the asynchronous task. If the task is not completed - * within 1 second however it is cancelled hard. + * within 1 second however it is canceled hard. */ @Override public void close() { @@ -124,7 +124,7 @@ public class AsyncUraTripReader implements AutoCloseable { } // Signal cancelling to gracefully stop future. - cancelled = true; + canceled = true; try { future.get(1, TimeUnit.SECONDS); } catch (InterruptedException e) {