Skip to content

Commit edad654

Browse files
committed
Add @pure annotations to SideInputReader
1 parent 8f5bc79 commit edad654

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

runners/core-java/src/main/java/org/apache/beam/runners/core/SideInputReader.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,22 @@
1919

2020
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
2121
import org.apache.beam.sdk.values.PCollectionView;
22-
import org.checkerframework.checker.nullness.qual.Nullable;
22+
import org.checkerframework.dataflow.qual.Pure;
2323

2424
/**
2525
* The interface to objects that provide side inputs. Particular implementations may read a side
2626
* input directly or use appropriate sorts of caching, etc.
2727
*/
2828
public interface SideInputReader {
29-
/**
30-
* Returns the value of the given {@link PCollectionView} for the given {@link BoundedWindow}.
31-
*
32-
* <p>It is valid for a side input to be {@code null}. It is <i>not</i> valid for this to return
33-
* {@code null} for any other reason.
34-
*/
35-
@Nullable
29+
/** Returns the value of the given {@link PCollectionView} for the given {@link BoundedWindow}. */
30+
@Pure
3631
<T> T get(PCollectionView<T> view, BoundedWindow window);
3732

3833
/** Returns true if the given {@link PCollectionView} is valid for this reader. */
34+
@Pure
3935
<T> boolean contains(PCollectionView<T> view);
4036

4137
/** Returns true if there are no side inputs in this reader. */
38+
@Pure
4239
boolean isEmpty();
4340
}

0 commit comments

Comments
 (0)