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