Annotation Interface FeatureAttribute


@Retention(RUNTIME) @Target(TYPE) public @interface FeatureAttribute

Annotation used to define custom metadata attributes for features.

Let's assume you want to define a custom attribute that holds the issue identifier of your issue tracker. To do so, create an annotation like this:

 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.FIELD)
 @FeatureAttribute("Issue")
 public @interface Issue {
     String value();
 }
 

Now you can use this new annotation on your feature enum like this:

 public enum MyFeatures implements Feature {
 
     @Label("My cool new feature")
     @Issue("TOGGLZ-123")
     MY_NEW_FEATURE;
 
 }
 
Author:
Christian Kaltepoth
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of the feature attribute.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The name of the method to call on the annotation to retrieve the value of the attribute.
  • Element Details

    • value

      String value
      The name of the feature attribute.
    • annotationAttribute

      String annotationAttribute
      The name of the method to call on the annotation to retrieve the value of the attribute.
      Default:
      "value"