Removed the equalsPrime thing, because that's just needlessly putting implementation details in there. If switching primes is so important, hash the type name and turn that into a prime, or something.

Also added some javadoc.
This commit is contained in:
Reinier Zwitserloot committed 2009-06-23 05:56:00 +02:00
1 parent fdde039d23
commit 794801c3c9
1 file changed
+11 -1
+11 -1
View File
@@ -8,6 +8,16 @@ import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface Data {
/**
* If you specify a static constructor name, then the generated constructor will be private, and
* instead a static factory method is created that other classes can use to create instances.
* We suggest the name: "of", like so:
*
* <pre>
* public @Data(staticConstructor = "of") class Point { final int x, y; }
* </pre>
*
* Default: No static constructor, instead the normal constructor is public.
*/
String staticConstructor() default "";
int hashCodePrime() default 31;
}