author | František Kučera <franta-hg@frantovo.cz> |
Tue Jan 11 15:27:51 2011 +0100 (2011-01-11) | |
changeset 163 | 5f0d5e1305b3 |
parent 156 | 5f14ce03f518 |
child 164 | e146e2e3b80b |
permissions | -rw-r--r-- |
franta-hg@10 | 1 |
package cz.frantovo.nekurak.dto; |
franta-hg@10 | 2 |
|
franta-hg@12 | 3 |
import java.io.Serializable; |
franta-hg@156 | 4 |
import java.net.URL; |
franta-hg@72 | 5 |
import java.util.ArrayList; |
franta-hg@39 | 6 |
import java.util.Date; |
franta-hg@127 | 7 |
import java.util.HashSet; |
franta-hg@72 | 8 |
import java.util.List; |
franta-hg@127 | 9 |
import java.util.Set; |
franta-hg@12 | 10 |
|
franta-hg@10 | 11 |
/** |
franta-hg@50 | 12 |
* Podnik – hospoda, bar, kavárna… |
franta-hg@10 | 13 |
* @author fiki |
franta-hg@10 | 14 |
*/ |
franta-hg@12 | 15 |
public class Podnik implements Serializable { |
franta-hg@10 | 16 |
|
franta-hg@145 | 17 |
private int id; |
franta-hg@145 | 18 |
private String nazev; |
franta-hg@145 | 19 |
private String popis; |
franta-hg@145 | 20 |
private String url; |
franta-hg@145 | 21 |
private String ulice; |
franta-hg@145 | 22 |
private Date datum; |
franta-hg@145 | 23 |
private Integer cisloPopisne; |
franta-hg@145 | 24 |
private String mesto; |
franta-hg@145 | 25 |
private String spravce; |
franta-hg@145 | 26 |
private List<Fotka> fotky = new ArrayList<Fotka>(); |
franta-hg@145 | 27 |
private Set<Komentar> komentare = new HashSet<Komentar>(); |
franta-hg@154 | 28 |
private Set<Kategorie> kategorie = new HashSet<Kategorie>(); |
franta-hg@145 | 29 |
private Double sirka; |
franta-hg@145 | 30 |
private Double delka; |
franta-hg@10 | 31 |
|
franta-hg@145 | 32 |
public Podnik() { |
franta-hg@145 | 33 |
} |
franta-hg@10 | 34 |
|
franta-hg@145 | 35 |
public Podnik(int id, String nazev) { |
franta-hg@145 | 36 |
this.id = id; |
franta-hg@145 | 37 |
this.nazev = nazev; |
franta-hg@145 | 38 |
} |
franta-hg@10 | 39 |
|
franta-hg@145 | 40 |
public int getId() { |
franta-hg@145 | 41 |
return id; |
franta-hg@145 | 42 |
} |
franta-hg@10 | 43 |
|
franta-hg@145 | 44 |
public void setId(int id) { |
franta-hg@145 | 45 |
this.id = id; |
franta-hg@145 | 46 |
} |
franta-hg@10 | 47 |
|
franta-hg@145 | 48 |
public String getNazev() { |
franta-hg@145 | 49 |
return nazev; |
franta-hg@145 | 50 |
} |
franta-hg@10 | 51 |
|
franta-hg@145 | 52 |
public void setNazev(String nazev) { |
franta-hg@145 | 53 |
this.nazev = nazev; |
franta-hg@145 | 54 |
} |
franta-hg@10 | 55 |
|
franta-hg@145 | 56 |
public String getPopis() { |
franta-hg@145 | 57 |
return popis; |
franta-hg@145 | 58 |
} |
franta-hg@39 | 59 |
|
franta-hg@145 | 60 |
public void setPopis(String popis) { |
franta-hg@145 | 61 |
this.popis = popis; |
franta-hg@145 | 62 |
} |
franta-hg@39 | 63 |
|
franta-hg@145 | 64 |
public String getUrl() { |
franta-hg@145 | 65 |
return url; |
franta-hg@145 | 66 |
} |
franta-hg@39 | 67 |
|
franta-hg@145 | 68 |
public void setUrl(String url) { |
franta-hg@145 | 69 |
this.url = url; |
franta-hg@145 | 70 |
} |
franta-hg@39 | 71 |
|
franta-hg@156 | 72 |
/** |
franta-hg@156 | 73 |
* Získá z URL webové stránky podniku doménové jméno převedené na malá písmena. |
franta-hg@156 | 74 |
* Např. z „http://www.example.com/index.html“ získá „www.example.com“. |
franta-hg@156 | 75 |
* @return doménové jméno nebo null v případě chyby. |
franta-hg@156 | 76 |
*/ |
franta-hg@156 | 77 |
public String getUrlDomena() { |
franta-hg@156 | 78 |
if (url == null) { |
franta-hg@156 | 79 |
return null; |
franta-hg@156 | 80 |
} else { |
franta-hg@156 | 81 |
try { |
franta-hg@156 | 82 |
URL u = new URL(url); |
franta-hg@156 | 83 |
String domena = u.getHost().toLowerCase(); |
franta-hg@156 | 84 |
if (domena.length() > 0) { |
franta-hg@156 | 85 |
return domena; |
franta-hg@156 | 86 |
} else { |
franta-hg@156 | 87 |
return null; |
franta-hg@156 | 88 |
} |
franta-hg@156 | 89 |
} catch (Exception e) { |
franta-hg@156 | 90 |
return null; |
franta-hg@156 | 91 |
} |
franta-hg@156 | 92 |
} |
franta-hg@156 | 93 |
} |
franta-hg@156 | 94 |
|
franta-hg@145 | 95 |
public String getUlice() { |
franta-hg@145 | 96 |
return ulice; |
franta-hg@145 | 97 |
} |
franta-hg@39 | 98 |
|
franta-hg@145 | 99 |
public void setUlice(String ulice) { |
franta-hg@145 | 100 |
this.ulice = ulice; |
franta-hg@145 | 101 |
} |
franta-hg@39 | 102 |
|
franta-hg@145 | 103 |
public Date getDatum() { |
franta-hg@145 | 104 |
return datum; |
franta-hg@145 | 105 |
} |
franta-hg@39 | 106 |
|
franta-hg@145 | 107 |
public void setDatum(Date datum) { |
franta-hg@145 | 108 |
this.datum = datum; |
franta-hg@145 | 109 |
} |
franta-hg@39 | 110 |
|
franta-hg@145 | 111 |
public int getCisloPopisne() { |
franta-hg@145 | 112 |
return cisloPopisne; |
franta-hg@145 | 113 |
} |
franta-hg@39 | 114 |
|
franta-hg@145 | 115 |
public void setCisloPopisne(int cisloPopisne) { |
franta-hg@145 | 116 |
this.cisloPopisne = cisloPopisne; |
franta-hg@145 | 117 |
} |
franta-hg@39 | 118 |
|
franta-hg@145 | 119 |
public String getMesto() { |
franta-hg@145 | 120 |
return mesto; |
franta-hg@145 | 121 |
} |
franta-hg@39 | 122 |
|
franta-hg@145 | 123 |
public void setMesto(String mesto) { |
franta-hg@145 | 124 |
this.mesto = mesto; |
franta-hg@145 | 125 |
} |
franta-hg@63 | 126 |
|
franta-hg@145 | 127 |
public String getSpravce() { |
franta-hg@145 | 128 |
return spravce; |
franta-hg@145 | 129 |
} |
franta-hg@63 | 130 |
|
franta-hg@145 | 131 |
public void setSpravce(String spravce) { |
franta-hg@145 | 132 |
this.spravce = spravce; |
franta-hg@145 | 133 |
} |
franta-hg@67 | 134 |
|
franta-hg@145 | 135 |
public List<Fotka> getFotky() { |
franta-hg@145 | 136 |
return fotky; |
franta-hg@145 | 137 |
} |
franta-hg@67 | 138 |
|
franta-hg@145 | 139 |
public void setFotky(List<Fotka> fotky) { |
franta-hg@145 | 140 |
this.fotky = fotky; |
franta-hg@145 | 141 |
} |
franta-hg@100 | 142 |
|
franta-hg@145 | 143 |
public Double getSirka() { |
franta-hg@145 | 144 |
return sirka; |
franta-hg@145 | 145 |
} |
franta-hg@100 | 146 |
|
franta-hg@145 | 147 |
public void setSirka(Double sirka) { |
franta-hg@145 | 148 |
this.sirka = sirka; |
franta-hg@145 | 149 |
} |
franta-hg@100 | 150 |
|
franta-hg@145 | 151 |
public Double getDelka() { |
franta-hg@145 | 152 |
return delka; |
franta-hg@145 | 153 |
} |
franta-hg@100 | 154 |
|
franta-hg@145 | 155 |
public void setDelka(Double delka) { |
franta-hg@145 | 156 |
this.delka = delka; |
franta-hg@145 | 157 |
} |
franta-hg@127 | 158 |
|
franta-hg@145 | 159 |
public Set<Komentar> getKomentare() { |
franta-hg@145 | 160 |
return komentare; |
franta-hg@145 | 161 |
} |
franta-hg@127 | 162 |
|
franta-hg@145 | 163 |
public void setKomentare(Set<Komentar> komentare) { |
franta-hg@145 | 164 |
this.komentare = komentare; |
franta-hg@145 | 165 |
} |
franta-hg@154 | 166 |
|
franta-hg@154 | 167 |
public Set<Kategorie> getKategorie() { |
franta-hg@154 | 168 |
return kategorie; |
franta-hg@154 | 169 |
} |
franta-hg@154 | 170 |
|
franta-hg@154 | 171 |
public void setKategorie(Set<Kategorie> kategorie) { |
franta-hg@154 | 172 |
this.kategorie = kategorie; |
franta-hg@154 | 173 |
} |
franta-hg@158 | 174 |
/** Půdou a sklepem projedete bez nebezpečí. */ |
franta-hg@10 | 175 |
} |