1 package com.dotmarketing.beans; 2 3 import java.io.Serializable ; 4 5 import org.apache.commons.lang.builder.EqualsBuilder; 6 import org.apache.commons.lang.builder.HashCodeBuilder; 7 import org.apache.commons.lang.builder.ToStringBuilder; 8 9 13 public class Tree implements Serializable { 14 15 private static final long serialVersionUID = 1L; 16 17 18 private long parent; 19 20 21 private long child; 22 23 24 private String relationType; 25 26 27 private int treeOrder = 0; 28 29 30 public Tree(long parent, long child, java.lang.String relationType, int treeOrder) { 31 this.parent = parent; 32 this.child = child; 33 this.relationType = relationType; 34 this.treeOrder = treeOrder; 35 } 36 37 38 public Tree() { 39 } 40 41 42 public Tree(long parent, long child) { 43 this.parent = parent; 44 this.child = child; 45 } 46 47 public long getParent() { 48 return this.parent; 49 } 50 51 public void setParent(long parent) { 52 this.parent = parent; 53 } 54 public long getChild() { 55 return this.child; 56 } 57 58 public void setChild(long child) { 59 this.child = child; 60 } 61 public java.lang.String getRelationType() { 62 return this.relationType; 63 } 64 65 public void setRelationType(java.lang.String relationType) { 66 this.relationType = relationType; 67 } 68 public int getTreeOrder() { 69 return this.treeOrder; 70 } 71 72 public void setTreeOrder(int treeOrder) { 73 this.treeOrder = treeOrder; 74 } 75 76 public String toString() { 77 return ToStringBuilder.reflectionToString(this); 78 } 79 80 public boolean equals(Object other) { 81 if ( !(other instanceof Tree) ) return false; 82 Tree castOther = (Tree) other; 83 return new EqualsBuilder() 84 .append(this.parent, castOther.parent) 85 .append(this.child, castOther.child) 86 .append(this.relationType, castOther.relationType) 87 .isEquals(); 88 } 89 90 public int hashCode() { 91 return new HashCodeBuilder() 92 .append(parent) 93 .append(child) 94 .append(this.relationType) 95 .toHashCode(); 96 } 97 } | Popular Tags |