Search code examples
javagoogle-cloud-platforminputstreamuser-inputapache-beam

Need details of how the "@" symbol in words google cloud apache beam code


private interface Options extends PipelineOptions {
    @Description("Path of the file to write to")
    @Validation.Required
    String getOutput();

Take the above code for example. It receive file details from user and validates that. (how?) Does it validate it against the datatype in the next line (String in this case) I don't seem to find any documentation on this. Is this from Java or specific to Apache Beam?


Solution

  • The @ syntax denotes an Annotation. Annotations are a feature of Java. Annotations can be processed at compile time or deployment time for a number of different effects, such as validation. In this case, command line argument validation for an Apache Beam pipeline.

    References:
    1. Java Annotations
    2. PipelineOptions Validation Annotation