author | František Kučera <franta-hg@frantovo.cz> |
Mon, 10 Jan 2011 17:27:53 +0100 | |
changeset 162 | 7ea45e9b10cb |
parent 149 | 8238cdb4113a |
permissions | -rw-r--r-- |
franta-hg@149 | 1 |
package cz.frantovo.nekurak.dto; |
franta-hg@149 | 2 |
|
franta-hg@149 | 3 |
import java.util.Date; |
franta-hg@149 | 4 |
|
franta-hg@149 | 5 |
/** |
franta-hg@149 | 6 |
* |
franta-hg@149 | 7 |
* @author fiki |
franta-hg@149 | 8 |
*/ |
franta-hg@149 | 9 |
public class ZpravaChatu { |
franta-hg@149 | 10 |
|
franta-hg@149 | 11 |
private String od; |
franta-hg@149 | 12 |
private Date kdy = new Date(); |
franta-hg@149 | 13 |
private String text; |
franta-hg@149 | 14 |
private boolean overenyUzivatel; |
franta-hg@149 | 15 |
private int poradoveCislo; |
franta-hg@149 | 16 |
|
franta-hg@149 | 17 |
public ZpravaChatu(String od, String text) { |
franta-hg@149 | 18 |
this.od = od; |
franta-hg@149 | 19 |
this.text = text; |
franta-hg@149 | 20 |
} |
franta-hg@149 | 21 |
|
franta-hg@149 | 22 |
public ZpravaChatu(String od, String text, boolean overenyUzivatel, int poradoveCislo) { |
franta-hg@149 | 23 |
this.od = od; |
franta-hg@149 | 24 |
this.text = text; |
franta-hg@149 | 25 |
this.overenyUzivatel = overenyUzivatel; |
franta-hg@149 | 26 |
this.poradoveCislo = poradoveCislo; |
franta-hg@149 | 27 |
} |
franta-hg@149 | 28 |
|
franta-hg@149 | 29 |
public String getOd() { |
franta-hg@149 | 30 |
return od; |
franta-hg@149 | 31 |
} |
franta-hg@149 | 32 |
|
franta-hg@149 | 33 |
public String getText() { |
franta-hg@149 | 34 |
return text; |
franta-hg@149 | 35 |
} |
franta-hg@149 | 36 |
|
franta-hg@149 | 37 |
public Date getKdy() { |
franta-hg@149 | 38 |
return kdy; |
franta-hg@149 | 39 |
} |
franta-hg@149 | 40 |
|
franta-hg@149 | 41 |
/** |
franta-hg@149 | 42 |
* @return true, pokud zprávu odeslal přihlášený uživatel (normálně přes jabber). |
franta-hg@149 | 43 |
* False, pokud zprávu odeslal nějaký anonym jen přes web. |
franta-hg@149 | 44 |
*/ |
franta-hg@149 | 45 |
public boolean isOverenyUzivatel() { |
franta-hg@149 | 46 |
return overenyUzivatel; |
franta-hg@149 | 47 |
} |
franta-hg@149 | 48 |
|
franta-hg@149 | 49 |
/** |
franta-hg@149 | 50 |
* @param overenyUzivatel true, pokud zprávu odeslal přihlášený uživatel (normálně přes jabber). |
franta-hg@149 | 51 |
* False, pokud zprávu odeslal nějaký anonym jen přes web. |
franta-hg@149 | 52 |
*/ |
franta-hg@149 | 53 |
public void setOverenyUzivatel(boolean overenyUzivatel) { |
franta-hg@149 | 54 |
this.overenyUzivatel = overenyUzivatel; |
franta-hg@149 | 55 |
} |
franta-hg@149 | 56 |
|
franta-hg@149 | 57 |
/** |
franta-hg@149 | 58 |
* @return Text zprávy – případně včetně přezdívky autora. |
franta-hg@149 | 59 |
*/ |
franta-hg@149 | 60 |
@Override |
franta-hg@149 | 61 |
public String toString() { |
franta-hg@149 | 62 |
if (od == null) { |
franta-hg@149 | 63 |
return text; |
franta-hg@149 | 64 |
} else { |
franta-hg@149 | 65 |
return od + ": " + text; |
franta-hg@149 | 66 |
} |
franta-hg@149 | 67 |
} |
franta-hg@149 | 68 |
|
franta-hg@149 | 69 |
public int getPoradoveCislo() { |
franta-hg@149 | 70 |
return poradoveCislo; |
franta-hg@149 | 71 |
} |
franta-hg@149 | 72 |
|
franta-hg@149 | 73 |
public void setPoradoveCislo(int poradoveCislo) { |
franta-hg@149 | 74 |
this.poradoveCislo = poradoveCislo; |
franta-hg@149 | 75 |
} |
franta-hg@149 | 76 |
} |