Files
lombok/usage_examples/GetterLazyExample_pre.jpage
T
peichhorn 917518bbea fixed type mismatch in lazy getter example (issue 223)
note: this example shows how lazy getter would work once issue 160 is no more
2011-06-22 09:52:00 +02:00

14 lines
295 B
Plaintext

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;
}
}