aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usage_examples/GetterSetterExample_post.jpage20
-rw-r--r--usage_examples/GetterSetterExample_pre.jpage12
-rw-r--r--website/features/GetterSetterExample.pngbin0 -> 76859 bytes
3 files changed, 32 insertions, 0 deletions
diff --git a/usage_examples/GetterSetterExample_post.jpage b/usage_examples/GetterSetterExample_post.jpage
new file mode 100644
index 00000000..b0921b86
--- /dev/null
+++ b/usage_examples/GetterSetterExample_post.jpage
@@ -0,0 +1,20 @@
+public class GetterSetterExample {
+ private int age = 10;
+ private String name;
+
+ @Override public String toString() {
+ return String.format("%s (age: %d)", age, name);
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ protected void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/usage_examples/GetterSetterExample_pre.jpage b/usage_examples/GetterSetterExample_pre.jpage
new file mode 100644
index 00000000..0da1d2e2
--- /dev/null
+++ b/usage_examples/GetterSetterExample_pre.jpage
@@ -0,0 +1,12 @@
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.Setter;
+
+public class GetterSetterExample {
+ private @Getter @Setter int age = 10;
+ private @Setter(AccessLevel.PROTECTED) String name;
+
+ @Override public String toString() {
+ return String.format("%s (age: %d)", age, name);
+ }
+}
diff --git a/website/features/GetterSetterExample.png b/website/features/GetterSetterExample.png
new file mode 100644
index 00000000..785a5984
--- /dev/null
+++ b/website/features/GetterSetterExample.png
Binary files differ