Permalink
Browse files

Added equals(), toString(), hashCode() methods to FluidGridItem.

  • Loading branch information...
1 parent 65e1eb3 commit 2fbcaf33c53563d03f57658260f085df440262f3 @melloware melloware committed Feb 10, 2017
Showing with 43 additions and 0 deletions.
  1. +43 −0 src/main/java/org/primefaces/extensions/model/fluidgrid/FluidGridItem.java
@@ -83,4 +83,47 @@ public void setData(final Object data) {
public String getType() {
return type;
}
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (key == null ? 0 : key.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (!(obj instanceof FluidGridItem)) {
+ return false;
+ }
+ final FluidGridItem other = (FluidGridItem) obj;
+ if (key == null) {
+ if (other.key != null) {
+ return false;
+ }
+ } else if (!key.equals(other.key)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("FluidGridItem [key=");
+ builder.append(key);
+ builder.append(", data=");
+ builder.append(data);
+ builder.append(", type=");
+ builder.append(type);
+ builder.append("]");
+ return builder.toString();
+ }
}

0 comments on commit 2fbcaf3

Please sign in to comment.