001 002 /** 003 * Ban.java - The ban class! Ban! Ban! Ban! 004 * 005 * @author James 006 */ 007 public class Ban { 008 009 private String name = "N/A", ip = "", reason = "N/A"; 010 private int id = -1, timestamp = -1; 011 012 /** 013 * Returns the specified IP address for this ban. Will be empty if no IP ban 014 * is associated 015 * 016 * @return the IP address 017 */ 018 public String getIp() { 019 return ip; 020 } 021 022 /** 023 * Sets the IP address of this ban 024 * 025 * @param ip 026 * ip to set 027 */ 028 public void setIp(String ip) { 029 this.ip = ip; 030 } 031 032 /** 033 * Returns the player's name for this ban 034 * 035 * @return player's name 036 */ 037 public String getName() { 038 return name; 039 } 040 041 /** 042 * Sets the player's name for this ban 043 * 044 * @param name 045 * player's name 046 */ 047 public void setName(String name) { 048 this.name = name; 049 } 050 051 /** 052 * Returns the ban reason. Will be "N/A" if none specified, or is an old ban 053 * 054 * @return ban reason 055 */ 056 public String getReason() { 057 return reason; 058 } 059 060 /** 061 * Sets the ban reason 062 * 063 * @param reason 064 * ban reason to set 065 */ 066 public void setReason(String reason) { 067 this.reason = reason; 068 } 069 070 /** 071 * Returns a UNIX timestamp for when this ban expires 072 * 073 * @return unix timestamp 074 */ 075 public int getTimestamp() { 076 return timestamp; 077 } 078 079 /** 080 * Sets the UNIX timestamp for this ban to expire at. 081 * 082 * @param timestamp 083 */ 084 public void setTimestamp(int timestamp) { 085 this.timestamp = timestamp; 086 } 087 088 /** 089 * Returns the SQL id for this ban (only used with SQL, not flat files) 090 * 091 * @return 092 */ 093 public int getId() { 094 return id; 095 } 096 097 /** 098 * Sets the SQL id for this ban (only used with SQL, not flat files) 099 * 100 * @param id 101 */ 102 public void setId(int id) { 103 this.id = id; 104 } 105 }