diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-02-02 04:47:21 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-02-02 04:52:20 +0100 |
commit | d8da2b9438056e945ecc38d98fed413444c847b3 (patch) | |
tree | 6d421923faaaf8566a7f827f3a803513c96c602b /src/core/lombok/experimental | |
parent | 46ce592dff458a0561fed900c0659bccb1755a1a (diff) | |
download | lombok-d8da2b9438056e945ecc38d98fed413444c847b3.tar.gz lombok-d8da2b9438056e945ecc38d98fed413444c847b3.tar.bz2 lombok-d8da2b9438056e945ecc38d98fed413444c847b3.zip |
added impl for @UtilityClass.
Diffstat (limited to 'src/core/lombok/experimental')
-rw-r--r-- | src/core/lombok/experimental/UtilityClass.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/lombok/experimental/UtilityClass.java b/src/core/lombok/experimental/UtilityClass.java index 778cfb80..80f3eee9 100644 --- a/src/core/lombok/experimental/UtilityClass.java +++ b/src/core/lombok/experimental/UtilityClass.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 The Project Lombok Authors. + * Copyright (C) 2015 The Project Lombok Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,9 +27,13 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * A helper to create utilities classes. - * <p> - * It makes the class final, makes all its methods static, creates a private default constructor that throws a RuntimeException when called and yields an error when other constructors are defined. + * An annotation to create utility classes. + * + * If a class is annotated with {@code @UtilityClass}, the following things happen to it:<ul> + * <li>It is marked final.</li> + * <li>If any constructors are declared in it, an error is generated. Otherwise, a private no-args constructor is generated; it throws a {@code UnsupportedOperationException}.</li> + * <li>All methods, inner classes, and fields in the class are marked static.</li> + * </ul> */ @Target({ElementType.TYPE}) @Retention(RetentionPolicy.SOURCE) |