1 46 package net.jforum.entities; 47 48 53 public class Group 54 { 55 private int id; 56 private int parentId; 57 private String name; 58 private String description; 59 60 63 public Group() {} 64 65 73 public Group(int id, int parentId, String name, String description) 74 { 75 setName(name); 76 setId(id); 77 setParentId(parentId); 78 setDescription(description); 79 } 80 81 84 public String getDescription() { 85 return this.description; 86 } 87 88 91 public int getId() { 92 return this.id; 93 } 94 95 98 public int getParentId() { 99 return this.parentId; 100 } 101 102 105 public String getName() { 106 return this.name; 107 } 108 109 113 public void setDescription(String description) { 114 this.description = description; 115 } 116 117 121 public void setId(int id) { 122 this.id = id; 123 } 124 125 129 public void setParentId(int parentId) { 130 this.parentId = parentId; 131 } 132 133 137 public void setName(String name) { 138 this.name = name; 139 } 140 141 144 public boolean equals(Object o) 145 { 146 if (!(o instanceof Group)) { 147 return false; 148 } 149 150 return (((Group)o).getId() == this.id); 151 } 152 153 156 public int hashCode() 157 { 158 return this.id; 159 } 160 161 164 public String toString() 165 { 166 return this.name +" - "+ this.id; 167 } 168 169 } 170 | Popular Tags |