简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM