diff options
author | Roel Spilker <r.spilker@gmail.com> | 2016-11-21 22:05:32 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2016-11-21 22:05:32 +0100 |
commit | 369518c92ce4e79ce62ce334497c9309e074f44c (patch) | |
tree | 3cb84cf0975e2f66d030b027fa73505c9dd0e574 /usage_examples | |
parent | 192c569128d1ffb879fb104f44483e394032a790 (diff) | |
parent | bae2018180e9eaf31b8a71a1f7d06e2265452f5c (diff) | |
download | lombok-369518c92ce4e79ce62ce334497c9309e074f44c.tar.gz lombok-369518c92ce4e79ce62ce334497c9309e074f44c.tar.bz2 lombok-369518c92ce4e79ce62ce334497c9309e074f44c.zip |
Merge branch 'bulgakovalexander-feature/var'
Diffstat (limited to 'usage_examples')
-rw-r--r-- | usage_examples/experimental/varExample_post.jpage | 21 | ||||
-rw-r--r-- | usage_examples/experimental/varExample_pre.jpage | 21 |
2 files changed, 42 insertions, 0 deletions
diff --git a/usage_examples/experimental/varExample_post.jpage b/usage_examples/experimental/varExample_post.jpage new file mode 100644 index 00000000..25623510 --- /dev/null +++ b/usage_examples/experimental/varExample_post.jpage @@ -0,0 +1,21 @@ +import java.util.ArrayList; +import lombok.var; + +public class ValExample { + public String example() { + ArrayList example = new ArrayList<String>(); + example.add("Hello, World!"); + final String foo = example.get(0); + return foo.toLowerCase(); + } + + public void example2() { + ArrayList list = new ArrayList<String>(); + list.add("zero"); + list.add("one"); + list.add("two"); + for(int i = 0; i < list.size(); ++i) { + System.out.printf("%d: %s\n", i, list.get(i)); + } + } +} diff --git a/usage_examples/experimental/varExample_pre.jpage b/usage_examples/experimental/varExample_pre.jpage new file mode 100644 index 00000000..0786c0df --- /dev/null +++ b/usage_examples/experimental/varExample_pre.jpage @@ -0,0 +1,21 @@ +import java.util.ArrayList; +import lombok.var; + +public class ValExample { + public String example() { + var example = new ArrayList<String>(); + example.add("Hello, World!"); + final var foo = example.get(0); + return foo.toLowerCase(); + } + + public void example2() { + var list = new ArrayList<String>(); + list.add("zero"); + list.add("one"); + list.add("two"); + for(var i = 0; i < list.size(); ++i) { + System.out.printf("%d: %s\n", i, list.get(i)); + } + } +} |