Skip to content

Commit

Permalink
Javadoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Dec 4, 2021
1 parent ad1a8c9 commit 656d202
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/org/apache/commons/lang3/Streams.java
Expand Up @@ -86,12 +86,22 @@ public FailableStream(final Stream<O> stream) {
this.stream = stream;
}

/**
* Throws IllegalStateException if this stream is already terminated.
*
* @throws IllegalStateException if this stream is already terminated.
*/
protected void assertNotTerminated() {
if (terminated) {
throw new IllegalStateException("This stream is already terminated.");
}
}

/**
* Marks this stream as terminated.
*
* @throws IllegalStateException if this stream is already terminated.
*/
protected void makeTerminated() {
assertNotTerminated();
terminated = true;
Expand Down

0 comments on commit 656d202

Please sign in to comment.