Annotation Interface ObservableInitial


Annotation applied to a static field or static method that supplies the initial value for an Observable property.

The annotation should be paired with an abstract Observable property on the same component. The annotated element must be a static, final field or a static method. The initial value will be used when constructing the generated component and removes the need to pass the value via the constructor.

If the associated Observable getter is annotated with Nonnull then the annotated field or method should also be annotated with Nonnull.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Return the name of the associated Observable.
  • Element Details

    • name

      @Nonnull String name
      Return the name of the associated Observable.

      If the annotation is applied to a method, this value will be derived if the method name matches the pattern "getInitial[Name]", otherwise it must be specified.

      If the annotation is applied to a field, this value will be derived if the field name matches the pattern "INITIAL_[NAME]", otherwise it must be specified.

      Returns:
      the name of the Observable.
      Default:
      "<default>"