1 20 21 package freecs.content; 22 23 import freecs.Server; 24 25 26 27 public class BanObject { 28 public String msg, bannedBy; public String usr, cookie, email; public Connection con; 31 public String hostban; 32 public long time; 33 public BanObject (String msg, String bannedBy, long time) { 34 this.bannedBy = bannedBy; 35 this.time = time; 36 this.msg = msg; 37 if (Server.TRACE_CREATE_AND_FINALIZE) 38 Server.log (this, "++++++++++++++++++++++++++++++++++++++++CREATE", Server.MSG_STATE, Server.LVL_VERY_VERBOSE); 39 } 40 41 public boolean equals (Object o) { 42 if (o == this) 43 return true; 44 if (!(o instanceof BanObject)) 45 return false; 46 BanObject bo = (BanObject) o; 47 if (this.usr == null && bo.usr != null) 48 return false; 49 if (this.usr != null && !this.usr.equals(bo.usr)) 50 return false; 51 if (this.cookie == null && bo.cookie != null) 52 return false; 53 if (this.cookie != null && !this.cookie.equals(bo.cookie)) 54 return false; 55 if (this.con == null && bo.con != null) 56 return false; 57 if (this.con != null && bo.con==null) 58 return false; 59 if (this.con != null && !this.con.getBanKey().equals(bo.con.getBanKey())) 60 return false; 61 if (this.email != null && !this.email.equals(bo.email)) 62 return false; 63 return true; 64 } 65 66 public void finalize() { 67 if (Server.TRACE_CREATE_AND_FINALIZE) 68 Server.log(this, "----------------------------------------FINALIZED", Server.MSG_STATE, Server.LVL_VERY_VERBOSE); 69 } 70 } | Popular Tags |