/*
- * Sone - Trust.java - Copyright © 2010 David Roden
+ * Sone - Trust.java - Copyright © 2010–2013 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
package net.pterodactylus.sone.freenet.wot;
+import static com.google.common.base.Objects.equal;
+
+import com.google.common.base.Objects;
+
/**
* Container class for trust in the web of trust.
*
return distance;
}
+ @Override
+ public boolean equals(Object object) {
+ if (!(object instanceof Trust)) {
+ return false;
+ }
+ Trust trust = (Trust) object;
+ return equal(getExplicit(), trust.getExplicit()) && equal(getImplicit(), trust.getImplicit()) && equal(getDistance(), trust.getDistance());
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(explicit, implicit, distance);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public String toString() {
+ return getClass().getName() + "[explicit=" + explicit + ",implicit=" + implicit + ",distance=" + distance + "]";
+ }
+
}