Annotation Interface ConstExpr


@Documented @Retention(CLASS) @Target({FIELD,METHOD}) public @interface ConstExpr

Simulating constexpr from c++11, with some slight modifications for methods. This annotation works on static fields and static methods:

  • Fields are resolved at build-time, removing any runtime execution.
  • Methods are removed at build-time. This way, methods can be exclusive to the build-time environment.

This feature only works with primitive and string type fields.