Skip to content

Commit 050848f

Browse files
committed
Add @pure annotations to DoFnSchemaInformation
1 parent 0430e4a commit 050848f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFnSchemaInformation.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.apache.beam.sdk.values.Row;
3434
import org.apache.beam.sdk.values.TypeDescriptor;
3535
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableList;
36+
import org.checkerframework.dataflow.qual.Pure;
3637

3738
/** Represents information about how a DoFn extracts schemas. */
3839
@AutoValue
@@ -46,12 +47,15 @@ public abstract class DoFnSchemaInformation implements Serializable {
4647
* The schema of the @Element parameter. If the Java type does not match the input PCollection but
4748
* the schemas are compatible, Beam will automatically convert between the Java types.
4849
*/
50+
@Pure
4951
public abstract List<SerializableFunction<?, ?>> getElementConverters();
5052

5153
/** Effective FieldAccessDescriptor applied by DoFn. */
54+
@Pure
5255
public abstract FieldAccessDescriptor getFieldAccessDescriptor();
5356

5457
/** Create an instance. */
58+
@Pure
5559
public static DoFnSchemaInformation create() {
5660
return new AutoValue_DoFnSchemaInformation.Builder()
5761
.setElementConverters(Collections.emptyList())
@@ -66,9 +70,11 @@ public abstract static class Builder {
6670

6771
abstract Builder setFieldAccessDescriptor(FieldAccessDescriptor descriptor);
6872

73+
@Pure
6974
abstract DoFnSchemaInformation build();
7075
}
7176

77+
@Pure
7278
public abstract Builder toBuilder();
7379

7480
/**

0 commit comments

Comments
 (0)