diff options
Diffstat (limited to 'website2/usageExamples/EqualsAndHashCodeExample_pre.jpage')
-rw-r--r-- | website2/usageExamples/EqualsAndHashCodeExample_pre.jpage | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/website2/usageExamples/EqualsAndHashCodeExample_pre.jpage b/website2/usageExamples/EqualsAndHashCodeExample_pre.jpage new file mode 100644 index 00000000..64faf59f --- /dev/null +++ b/website2/usageExamples/EqualsAndHashCodeExample_pre.jpage @@ -0,0 +1,25 @@ +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(exclude={"id", "shape"}) +public class EqualsAndHashCodeExample { + private transient int transientVar = 10; + private String name; + private double score; + private Shape shape = new Square(5, 10); + private String[] tags; + private int id; + + public String getName() { + return this.name; + } + + @EqualsAndHashCode(callSuper=true) + public static class Square extends Shape { + private final int width, height; + + public Square(int width, int height) { + this.width = width; + this.height = height; + } + } +} |