1 package com.calipso.reportgenerator.common; 2 3 import java.util.Collections ; 4 import java.util.ArrayList ; 5 import java.util.HashMap ; 6 7 13 14 public class User implements Comparable { 15 16 private String user; 17 private String name; 18 private String company; 19 20 25 public User(String id, String name){ 26 this.user = id; 27 this.name = name; 28 } 29 34 public User(String id, String name,String company){ 35 this.user = id; 36 this.name = name; 37 this.company = company; 38 } 39 43 public String getUserName() { 44 return name; 45 } 46 50 public String getId() { 51 return user; 52 } 53 57 public String getCompany() { 58 return company; 59 } 60 64 public void setName(String name) { 65 this.name=name; 66 } 67 71 public void setCompany(String company) { 72 this.company = company; 73 } 74 78 public String toString(){ 79 return getUserName(); 80 } 81 89 public int compareTo(Object o) { 90 User us = (User) o; 91 return this.getId().compareTo(us.getId()); 92 } 93 99 public boolean equals(Object o){ 100 User us = (User) o; 101 return this.getId().equals(us.getId()); 102 } 103 107 public int hashCode(){ 108 return getId().hashCode(); 109 } 110 } 111 112 113 114 | Popular Tags |