Annotation Interface ComputableValueRef


Marks a template method that returns the ComputableValue instance for the Memoize annotated property. Each property marked with the Memoize annotation is backed by an ComputableValue instance and some frameworks make use of this value to implement advanced functionality.

The method that is annotated with this annotation must also comply with the following constraints:

  • Must have the exact same parameter types as the associated Memoize annotated method
  • Must not be annotated with any other arez annotation
  • Must be abstract
  • Must not throw any exceptions
  • Must return an instance of ComputableValue.
  • Must be accessible to the class annotated by the ArezComponent annotation.
  • Should not be public as not expected to be invoked outside the component. A warning will be generated but can be suppressed by the SuppressWarnings or SuppressArezWarnings annotations with a key "Arez:PublicRefMethod". This warning is also suppressed by the annotation processor if it is implementing an interface method.
  • Should not be protected if in the class annotated with the ArezComponent annotation as the method is not expected to be invoked outside the component. A warning will be generated but can be suppressed by the SuppressWarnings or SuppressArezWarnings annotations with a key "Arez:ProtectedMethod".
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Return the name of the associated Memoize property that this ref relates to.
  • Element Details

    • name

      @Nonnull String name
      Return the name of the associated Memoize property that this ref relates to. This value will be derived if the method name matches the pattern "get[Name]ComputableValue", otherwise it must be specified.
      Returns:
      the name of the associated ComputableValue.
      Default:
      "<default>"