aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Michajlo Matijkiw <michajlo@google.com>2016-06-09 18:51:18 +0000
committerGravatar Yun Peng <pcloudy@google.com>2016-06-10 07:51:52 +0000
commit586f80fd2fa5c96660d0e845b5bfcc7ceeaa571a (patch)
treebd88c2d14b6e778a2325e9fc55bcd49228a1b844
parentf54af6ee59747771c790ca64f85e451470360b64 (diff)
Add equals & hashcode for FilesetEnty
-- MOS_MIGRATED_REVID=124481285
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/FilesetEntry.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/FilesetEntry.java b/src/main/java/com/google/devtools/build/lib/packages/FilesetEntry.java
index c94216400f..e55a4ed307 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/FilesetEntry.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/FilesetEntry.java
@@ -14,6 +14,7 @@
package com.google.devtools.build.lib.packages;
+import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
@@ -246,4 +247,30 @@ public final class FilesetEntry implements SkylarkValue {
files != null ? files.size() : 0,
excludes != null ? excludes.size() : 0);
}
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(srcLabel, files, excludes, destDir, symlinkBehavior, stripPrefix);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (this == other) {
+ return true;
+ }
+
+ if (!(other instanceof FilesetEntry)) {
+ return false;
+ }
+
+ FilesetEntry that = (FilesetEntry) other;
+ return Objects.equal(srcLabel, that.srcLabel)
+ && Objects.equal(files, that.files)
+ && Objects.equal(excludes, that.excludes)
+ && Objects.equal(destDir, that.destDir)
+ && Objects.equal(symlinkBehavior, that.symlinkBehavior)
+ && Objects.equal(stripPrefix, that.stripPrefix);
+ }
+
+
}