From 4fbbd8ed03f7963715bc6e7c7de6faae0b1ba917 Mon Sep 17 00:00:00 2001 From: Bulgakov Alexander Date: Mon, 31 Oct 2016 23:52:20 +0300 Subject: added var.html --- website/features/experimental/index.html | 2 + website/features/experimental/var.html | 83 ++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 website/features/experimental/var.html (limited to 'website') diff --git a/website/features/experimental/index.html b/website/features/experimental/index.html index f3893674..4a6d12bb 100644 --- a/website/features/experimental/index.html +++ b/website/features/experimental/index.html @@ -22,6 +22,8 @@ Features that receive positive community feedback and which seem to produce clean, flexible code will eventually become accepted as a core feature and move out of the experimental package.
+
@var
+
The same as @val but modifiable.
@Accessors
A more fluent API for getters and setters.
@ExtensionMethod
diff --git a/website/features/experimental/var.html b/website/features/experimental/var.html new file mode 100644 index 00000000..7a045c00 --- /dev/null +++ b/website/features/experimental/var.html @@ -0,0 +1,83 @@ + + + + + + + + EXPERIMENTAL – @var +
+
+
+ +

@var

+ +
+

Since

+

+ @var was introduced as experimental feature in lombok v1.16.11. +

+
+
+

Experimental

+

+ Experimental because: +

    +
  • This feature is very controversial.
  • +
  • There is JEP 286 that should make the @var obsolete.
  • +
Current status: uncertain - Currently we feel this feature cannot move out of experimental status. +
+
+

Overview

+

+ The @var has the same mission as the @val annotation but modifable. +

+
+
+
+

With Lombok

+
@HTML_PRE@
+
+
+
+

Vanilla Java

+
@HTML_POST@
+
+
+
+
+

Supported configuration keys:

+
+
lombok.val.flagUsage = [allow] (default: not set)
+
Lombok will flag any usage of var as a error if not configured.
+
+
+
+

Small print

+

+ For compound types, the most common superclass is inferred, not any shared interfaces. For example, bool ? new HashSet() : new ArrayList() + is an expression with a compound type: The result is both AbstractCollection as well as Serializable. The type inferred will be + AbstractCollection, as that is a class, whereas Serializable is an interface. +

+ In ambiguous cases, such as when the initializer expression is null, java.lang.Object is inferred. +

+
+
+ +
+
+
+ + + -- cgit