From 8b7a7cbc813653a3248d6cf3a7779e220957bc85 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 8 May 2017 21:28:02 +0200 Subject: The great rename: the old ‘website’ is now ‘website-old’, and ‘website2’ is now ‘website’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/usageExamples/GetterLazyExample_pre.jpage | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 website/usageExamples/GetterLazyExample_pre.jpage (limited to 'website/usageExamples/GetterLazyExample_pre.jpage') diff --git a/website/usageExamples/GetterLazyExample_pre.jpage b/website/usageExamples/GetterLazyExample_pre.jpage new file mode 100644 index 00000000..ca6c9d58 --- /dev/null +++ b/website/usageExamples/GetterLazyExample_pre.jpage @@ -0,0 +1,13 @@ +import lombok.Getter; + +public class GetterLazyExample { + @Getter(lazy=true) private final double[] cached = expensive(); + + private double[] expensive() { + double[] result = new double[1000000]; + for (int i = 0; i < result.length; i++) { + result[i] = Math.asin(i); + } + return result; + } +} -- cgit