You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by br...@apache.org on 2015/05/04 21:47:18 UTC

[3/8] [lang] Better JavaDoc for HashCodeExclude

Better JavaDoc for HashCodeExclude


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/0e67448f
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/0e67448f
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/0e67448f

Branch: refs/heads/master
Commit: 0e67448f8b7d6a3b606d6c6d31574ed5329271f9
Parents: 758f567
Author: Benedikt Ritter <br...@apache.org>
Authored: Mon May 4 21:12:20 2015 +0200
Committer: Benedikt Ritter <br...@apache.org>
Committed: Mon May 4 21:13:47 2015 +0200

----------------------------------------------------------------------
 .../commons/lang3/builder/HashCodeBuilder.java       | 15 +++++++++++++++
 .../commons/lang3/builder/HashCodeExclude.java       |  4 +++-
 2 files changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/0e67448f/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java b/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java
index fbbd110..a2956a5 100644
--- a/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java
+++ b/src/main/java/org/apache/commons/lang3/builder/HashCodeBuilder.java
@@ -94,6 +94,9 @@ import org.apache.commons.lang3.Validate;
  *   return HashCodeBuilder.reflectionHashCode(this);
  * }
  * </pre>
+ * 
+ * <p>The {@link HashCodeExclude} annotation can be used to exclude fields from being
+ * used by the <code>reflectionHashCode</code> methods.</p>
  *
  * @since 1.0
  * @version $Id$
@@ -246,6 +249,8 @@ public class HashCodeBuilder implements Builder<Integer> {
      *             if the Object is <code>null</code>
      * @throws IllegalArgumentException
      *             if the number is zero or even
+     *
+     * @see HashCodeExclude
      */
     public static int reflectionHashCode(final int initialNonZeroOddNumber, final int multiplierNonZeroOddNumber, final Object object) {
         return reflectionHashCode(initialNonZeroOddNumber, multiplierNonZeroOddNumber, object, false, null);
@@ -290,6 +295,8 @@ public class HashCodeBuilder implements Builder<Integer> {
      *             if the Object is <code>null</code>
      * @throws IllegalArgumentException
      *             if the number is zero or even
+     *
+     * @see HashCodeExclude
      */
     public static int reflectionHashCode(final int initialNonZeroOddNumber, final int multiplierNonZeroOddNumber, final Object object,
             final boolean testTransients) {
@@ -342,6 +349,8 @@ public class HashCodeBuilder implements Builder<Integer> {
      *             if the Object is <code>null</code>
      * @throws IllegalArgumentException
      *             if the number is zero or even
+     *
+     * @see HashCodeExclude
      * @since 2.0
      */
     public static <T> int reflectionHashCode(final int initialNonZeroOddNumber, final int multiplierNonZeroOddNumber, final T object,
@@ -392,6 +401,8 @@ public class HashCodeBuilder implements Builder<Integer> {
      * @return int hash code
      * @throws IllegalArgumentException
      *             if the object is <code>null</code>
+     *
+     * @see HashCodeExclude
      */
     public static int reflectionHashCode(final Object object, final boolean testTransients) {
         return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object, 
@@ -430,6 +441,8 @@ public class HashCodeBuilder implements Builder<Integer> {
      * @return int hash code
      * @throws IllegalArgumentException
      *             if the object is <code>null</code>
+     *
+     * @see HashCodeExclude
      */
     public static int reflectionHashCode(final Object object, final Collection<String> excludeFields) {
         return reflectionHashCode(object, ReflectionToStringBuilder.toNoNullStringArray(excludeFields));
@@ -469,6 +482,8 @@ public class HashCodeBuilder implements Builder<Integer> {
      * @return int hash code
      * @throws IllegalArgumentException
      *             if the object is <code>null</code>
+     *
+     * @see HashCodeExclude
      */
     public static int reflectionHashCode(final Object object, final String... excludeFields) {
         return reflectionHashCode(DEFAULT_INITIAL_VALUE, DEFAULT_MULTIPLIER_VALUE, object, false, 

http://git-wip-us.apache.org/repos/asf/commons-lang/blob/0e67448f/src/main/java/org/apache/commons/lang3/builder/HashCodeExclude.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/builder/HashCodeExclude.java b/src/main/java/org/apache/commons/lang3/builder/HashCodeExclude.java
index 369f0bc..25bac4c 100755
--- a/src/main/java/org/apache/commons/lang3/builder/HashCodeExclude.java
+++ b/src/main/java/org/apache/commons/lang3/builder/HashCodeExclude.java
@@ -23,7 +23,9 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
 /**
- * Use this annotation to builds a hash code excluding the annotated field.
+ * Use this annotation to exclude a field from being being used by
+ * the various <code>reflectionHashcode</code> methods defined on
+ * {@link HashCodeBuilder}.
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.FIELD)