Annotation Interface RequireOnlyOne


@Retention(RUNTIME) @Target(FIELD) public @interface RequireOnlyOne
Annotation that indicates that you only permit one option from some set of options to be present, the set of options are identified by a user defined tag.

By using the same tag across several annotated options you can state that you require only one of those options to be present. If you require one/more from some set of options you should instead use the less restrictive RequireSome. If you optionally require at most one from some set of options you can use MutuallyExclusiveWith instead.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Provides a tag used to identify some set of options
  • Element Details

    • tag

      String tag
      Provides a tag used to identify some set of options
      Returns:
      Tag
      Default:
      ""